Skip to content

Commit

Permalink
Merge pull request #1361 from seanpile/keep_list_open
Browse files Browse the repository at this point in the history
Added ability to keep the quickfix/location list window open
  • Loading branch information
fatih authored Jul 22, 2017
2 parents 4e3f55b + 06987d5 commit e566738
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
17 changes: 11 additions & 6 deletions autoload/go/list.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ if !exists("g:go_list_type")
endif

" Window opens the list with the given height up to 10 lines maximum.
" Otherwise g:go_loclist_height is used. If no or zero height is given it
" closes the window
" Otherwise g:go_loclist_height is used.
"
" If no or zero height is given it closes the window by default.
" To prevent this, set g:go_list_autoclose = 0
function! go#list#Window(listtype, ...) abort
let l:listtype = go#list#Type(a:listtype)
" we don't use lwindow to close the location list as we need also the
Expand All @@ -13,10 +15,13 @@ function! go#list#Window(listtype, ...) abort
" location list increases/decreases, cwindow will not resize when a new
" updated height is passed. lopen in the other hand resizes the screen.
if !a:0 || a:1 == 0
if l:listtype == "locationlist"
lclose
else
cclose
let autoclose_window = get(g:, 'go_list_autoclose', 1)
if autoclose_window
if l:listtype == "locationlist"
lclose
else
cclose
endif
endif
return
endif
Expand Down
10 changes: 10 additions & 0 deletions doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,16 @@ Supported values are "", "quickfix", and "locationlist". >
let g:go_list_type = ""
<

*'g:go_list_autoclose'*

Specifies whether the quickfix/location list should be closed automatically
in the absence of errors. The default value is 1.
If you prefer to keep a long running error window open, you can disable
this by setting the value to 0.
>
let g:go_list_autoclose = 1
<
*'g:go_asmfmt_autosave'*

Use this option to auto |:AsmFmt| on save. By default it's disabled. >
Expand Down

0 comments on commit e566738

Please sign in to comment.