Skip to content

Commit

Permalink
Check loclist before quickfix
Browse files Browse the repository at this point in the history
Fix [f in loclist fails gives message about quickfix instead of doing
:lolder

:h getwininfo() says:
    loclist		1 if showing a location list
    quickfix	1 if quickfix or location list window

Since quickfix is true for both, we need to check it last.

Test
    h getloc
    lgetbuffer
    h :lgetbuffer
    lgetbuffer
    lopen
    " at this point [f will fail but lolder will not
  • Loading branch information
idbrii authored and tpope committed Apr 29, 2022
1 parent e52cb4d commit cf9d74c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugin/unimpaired.vim
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ endfunction
function! s:PreviousFileEntry(count) abort
let window = s:GetWindow()

if get(window, 'quickfix')
return 'colder ' . a:count
elseif get(window, 'loclist')
if get(window, 'loclist')
return 'lolder ' . a:count
elseif get(window, 'quickfix')
return 'colder ' . a:count
else
return 'edit ' . s:fnameescape(fnamemodify(s:FileByOffset(-v:count1), ':.'))
endif
Expand All @@ -151,10 +151,10 @@ endfunction
function! s:NextFileEntry(count) abort
let window = s:GetWindow()

if get(window, 'quickfix')
return 'cnewer ' . a:count
elseif get(window, 'loclist')
if get(window, 'loclist')
return 'lnewer ' . a:count
elseif get(window, 'quickfix')
return 'cnewer ' . a:count
else
return 'edit ' . s:fnameescape(fnamemodify(s:FileByOffset(v:count1), ':.'))
endif
Expand Down

0 comments on commit cf9d74c

Please sign in to comment.