From d36686e6a52b363c9f0a4fc9b67ca5f974704aa1 Mon Sep 17 00:00:00 2001 From: Richard Robbins Date: Sat, 16 Nov 2019 11:36:58 -0800 Subject: [PATCH] Add g:gitgutter_use_location_list option --- autoload/gitgutter.vim | 6 +++++- doc/gitgutter.txt | 11 ++++++++++- plugin/gitgutter.vim | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/autoload/gitgutter.vim b/autoload/gitgutter.vim index 84c89af..582ea4b 100644 --- a/autoload/gitgutter.vim +++ b/autoload/gitgutter.vim @@ -207,5 +207,9 @@ function! gitgutter#quickfix() let lnum = 0 endif endfor - call setqflist(locations) + if !g:gitgutter_use_location_list + call setqflist(locations) + else + call setloclist(0, locations) + endif endfunction diff --git a/doc/gitgutter.txt b/doc/gitgutter.txt index a9b4e91..2380514 100644 --- a/doc/gitgutter.txt +++ b/doc/gitgutter.txt @@ -140,7 +140,9 @@ Commands for jumping between hunks:~ *gitgutter-:GitGutterQuickFix* :GitGutterQuickFix Load all hunks into the |quickfix| list. Note this - ignores any unsaved changes in your buffers. + ignores any unsaved changes in your buffers. The + |g:gitgutter_use_location_list| option can be set to + populate the location list of the current window instead Commands for operating on a hunk:~ @@ -294,6 +296,7 @@ General:~ |g:gitgutter_map_keys| |g:gitgutter_async| |g:gitgutter_log| + |g:gitgutter_use_location_list| *g:gitgutter_preview_win_location* @@ -487,6 +490,12 @@ Default: 0 When switched on, the plugin logs to gitgutter.log in the directory where it is installed. Additionally it logs channel activity to channel.log. + *g:gitgutter_use_location_list* +Default: 0 + +When switched on, the :GitGutterQuickFix command populates the location list +of the current window instead of the global quickfix list. + =============================================================================== HIGHLIGHTS *gitgutter-highlights* diff --git a/plugin/gitgutter.vim b/plugin/gitgutter.vim index c7073d0..99e0bd2 100644 --- a/plugin/gitgutter.vim +++ b/plugin/gitgutter.vim @@ -61,6 +61,7 @@ call s:set('g:gitgutter_map_keys', 1) call s:set('g:gitgutter_terminal_reports_focus', 1) call s:set('g:gitgutter_async', 1) call s:set('g:gitgutter_log', 0) +call s:set('g:gitgutter_use_location_list', 0) call s:set('g:gitgutter_git_executable', 'git') if !executable(g:gitgutter_git_executable)