File tree 1 file changed +12
-9
lines changed
1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -127,19 +127,22 @@ function! go#fmt#update_file(source, target)
127
127
let &fileformat = old_fileformat
128
128
let &syntax = &syntax
129
129
130
+ let l: listtype = go#list#Type (" GoFmt" )
131
+
130
132
" the title information was introduced with 7.4-2200
131
133
" https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
132
- if ! has (' patch-7.4-2200' )
133
- return
134
- endif
135
-
136
- " clean up previous list
137
- let l: listtype = go#list#Type (" GoFmt" )
138
- if l: listtype == " quickfix"
139
- let l: list_title = getqflist ({' title' : 1 })
134
+ if has (' patch-7.4-2200' )
135
+ " clean up previous list
136
+ if l: listtype == " quickfix"
137
+ let l: list_title = getqflist ({' title' : 1 })
138
+ else
139
+ let l: list_title = getloclist (0 , {' title' : 1 })
140
+ endif
140
141
else
141
- let l: list_title = getloclist (0 , {' title' : 1 })
142
+ " can't check the title, so assume that the list was for go fmt.
143
+ let l: list_title = {' title' : ' Format' }
142
144
endif
145
+
143
146
if has_key (l: list_title , " title" ) && l: list_title [' title' ] == " Format"
144
147
call go#list#Clean (l: listtype )
145
148
call go#list#Window (l: listtype )
You can’t perform that action at this time.
0 commit comments