File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ endfunction
179
179
" - this runs synchronously
180
180
" - it ignores unsaved changes in buffers
181
181
" - it does not change to the repo root
182
- function ! gitgutter#quickfix ()
182
+ function ! gitgutter#quickfix (current_file )
183
183
let cmd = g: gitgutter_git_executable .' ' .g: gitgutter_git_args .' rev-parse --show-cdup'
184
184
let path_to_repo = get (systemlist (cmd), 0 , ' ' )
185
185
if ! empty (path_to_repo) && path_to_repo[-1 :] != ' /'
@@ -191,6 +191,9 @@ function! gitgutter#quickfix()
191
191
\ ' diff --no-ext-diff --no-color -U0' .
192
192
\ ' --src-prefix=a/' .path_to_repo.' --dst-prefix=b/' .path_to_repo.' ' .
193
193
\ g: gitgutter_diff_args . ' ' . g: gitgutter_diff_base
194
+ if a: current_file
195
+ let cmd = cmd.' -- ' .expand (' %:p' )
196
+ endif
194
197
let diff = systemlist (cmd)
195
198
let lnum = 0
196
199
for line in diff
Original file line number Diff line number Diff line change @@ -158,6 +158,11 @@ Commands for jumping between hunks:~
158
158
>
159
159
command! Gqf GitGutterQuickFix | copen
160
160
<
161
+ *gitgutter-:GitGutterQuickFixCurrentFile*
162
+ :GitGutterQuickFixCurrentFile Same as :GitGutterQuickFix, but only load hunks for
163
+ the file in the focused buffer. This has the same
164
+ functionality as :GitGutterQuickFix when the focused
165
+ buffer is empty.
161
166
162
167
163
168
Commands for operating on a hunk:~
Original file line number Diff line number Diff line change @@ -118,7 +118,8 @@ command! -bar GitGutterBufferDisable call gitgutter#buffer_disable()
118
118
command ! - bar GitGutterBufferEnable call gitgutter#buffer_enable ()
119
119
command ! - bar GitGutterBufferToggle call gitgutter#buffer_toggle ()
120
120
121
- command ! - bar GitGutterQuickFix call gitgutter#quickfix ()
121
+ command ! - bar GitGutterQuickFix call gitgutter#quickfix (v: false )
122
+ command ! - bar GitGutterQuickFixCurrentFile call gitgutter#quickfix (v: true )
122
123
123
124
" }}}
124
125
You can’t perform that action at this time.
0 commit comments