Skip to content

Commit 8e052ad

Browse files
authored
Update EnhancedDiff.vim
1 parent 38a1dd7 commit 8e052ad

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

autoload/EnhancedDiff.vim

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ def s:ModifyDiffFiles(): void #{{{2
7575
endif
7676
enddef
7777
def s:Warn(msg: string) #{{{2
78-
echohl WarningMsg
79-
unsilent echomsg "EnhancedDiff: ". msg
78+
echohl WarningMsg ' unsilent echomsg "EnhancedDiff: ' .. msg
8079
echohl Normal
8180
enddef
8281
def s:ModifyPathAndCD(file: string): string #{{{2
@@ -153,15 +152,16 @@ def s:SysList(cmd: string): string
153152
return split(system(cmd), '\n')
154153
enddef
155154
function EnhancedDiff#Diff(...) #{{{2
156-
let cmd=(exists("a:1") ? a:1 : '')
157-
let arg=(exists("a:2") ? a:2 : '')
155+
let cmd = (exists("a:1") ? a:1 : '')
156+
let arg = (exists("a:2") ? a:2 : '')
157+
158+
" no-op
159+
" error occured, reset diffexpr
158160
try
159161
call s:DiffInit(cmd, arg)
160162
catch
161-
# no-op
162-
# error occured, reset diffexpr
163163
set diffexpr=
164-
call s:Warn(cmd. ' not found in path, aborting!')
164+
call s:Warn( cmd . ' not found in path, aborting!' )
165165
return
166166
endtry
167167
call s:ModifyDiffFiles()
@@ -171,23 +171,23 @@ function EnhancedDiff#Diff(...) #{{{2
171171
let difflist=s:SysList(s:diffcmd . ' ' . join(s:diffargs, ' '))
172172
call s:ModifyPathAndCD('-')
173173
if v:shell_error < 0 || v:shell_error > 1
174-
# An error occured
174+
" An error occured
175175
set diffexpr=
176176
call s:Warn(cmd. ' Error executing "'. s:diffcmd. ' '.join(s:diffargs, ' ').'"')
177177
call s:Warn(difflist[0])
178178
return
179179
endif
180-
# if unified diff...
181-
# do some processing here
180+
" if unified diff...
181+
" do some processing here
182182
if !empty(difflist) && difflist[0] !~# '\m\C^\%(\d\+\)\%(,\d\+\)\?[acd]\%(\d\+\)\%(,\d\+\)\?'
183-
# transform into normal diff
183+
" transform into normal diff
184184
let difflist=EnhancedDiff#ConvertToNormalDiff(difflist)
185185
endif
186186
call writefile(difflist, v:fname_out)
187187
if get(g:, 'enhanced_diff_debug', 0)
188-
# This is needed for the tests.
188+
" This is needed for the tests.
189189
call writefile(difflist, 'EnhancedDiff_normal.txt')
190-
# Also write default diff
190+
" Also write default diff
191191
let opt = "-a --binary "
192192
if &diffopt =~ "icase"
193193
let opt .= "-i "

0 commit comments

Comments
 (0)