@@ -75,8 +75,7 @@ def s:ModifyDiffFiles(): void #{{{2
75
75
endif
76
76
enddef
77
77
def s: Warn (msg: string ) #{{{2
78
- echohl WarningMsg
79
- unsilent echomsg " EnhancedDiff: " . msg
78
+ echohl WarningMsg ' unsilent echomsg "EnhancedDiff: ' .. msg
80
79
echohl Normal
81
80
enddef
82
81
def s: ModifyPathAndCD (file : string ): string #{{{2
@@ -153,15 +152,16 @@ def s:SysList(cmd: string): string
153
152
return split (system (cmd), ' \n' )
154
153
enddef
155
154
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
158
160
try
159
161
call s: DiffInit (cmd, arg)
160
162
catch
161
- # no -op
162
- # error occured, reset diffexpr
163
163
set diffexpr =
164
- call s: Warn (cmd. ' not found in path, aborting!' )
164
+ call s: Warn ( cmd . ' not found in path, aborting!' )
165
165
return
166
166
endtry
167
167
call s: ModifyDiffFiles ()
@@ -171,23 +171,23 @@ function EnhancedDiff#Diff(...) #{{{2
171
171
let difflist= s: SysList (s: diffcmd . ' ' . join (s: diffargs , ' ' ))
172
172
call s: ModifyPathAndCD (' -' )
173
173
if v: shell_error < 0 || v: shell_error > 1
174
- # An error occured
174
+ " An error occured
175
175
set diffexpr =
176
176
call s: Warn (cmd. ' Error executing "' . s: diffcmd . ' ' .join (s: diffargs , ' ' ).' "' )
177
177
call s: Warn (difflist[0 ])
178
178
return
179
179
endif
180
- # if unified diff ...
181
- # do some processing here
180
+ " if unified diff...
181
+ " do some processing here
182
182
if ! empty (difflist) && difflist[0 ] !~# ' \m\C^\%(\d\+\)\%(,\d\+\)\?[acd]\%(\d\+\)\%(,\d\+\)\?'
183
- # transform into normal diff
183
+ " transform into normal diff
184
184
let difflist= EnhancedDiff#ConvertToNormalDiff (difflist)
185
185
endif
186
186
call writefile (difflist, v: fname_out )
187
187
if get (g: , ' enhanced_diff_debug' , 0 )
188
- # This is needed for the tests.
188
+ " This is needed for the tests.
189
189
call writefile (difflist, ' EnhancedDiff_normal.txt' )
190
- # Also write default diff
190
+ " Also write default diff
191
191
let opt = " -a --binary "
192
192
if &diffopt = ~ " icase"
193
193
let opt .= " -i "
0 commit comments