Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions autoload/qf/wrap.vim
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ set cpo&vim
" TODO (romainl): Built-in :cn/:cp/:ln/:lp stop at the beginning
" and end of the list. This allows us to wrap
" around.
function! qf#wrap#WrapCommand(direction, prefix)
function! qf#wrap#WrapCommand(direction, prefix, count)
if a:direction == "up"
try
execute a:prefix . "previous"
execute a:count . a:prefix . "previous"
catch /^Vim\%((\a\+)\)\=:E553/
execute a:prefix . "last"
catch /^Vim\%((\a\+)\)\=:E\%(325\|776\|42\):/
endtry
else
try
execute a:prefix . "next"
execute a:count . a:prefix . "next"
catch /^Vim\%((\a\+)\)\=:E553/
execute a:prefix . "first"
catch /^Vim\%((\a\+)\)\=:E\%(325\|776\|42\):/
Expand Down
8 changes: 4 additions & 4 deletions plugin/qf.vim
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ nmap <silent> <Plug>QfLtoggle <Plug>(qf_loc_toggle)
nmap <silent> <expr> <Plug>QfSwitch &filetype ==# 'qf' ? '<C-w>p' : '<C-w>b'

" Go up and down quickfix list
nnoremap <silent> <Plug>(qf_qf_previous) :<C-u> call qf#wrap#WrapCommand('up', 'c')<CR>
nnoremap <silent> <Plug>(qf_qf_next) :<C-u> call qf#wrap#WrapCommand('down', 'c')<CR>
nnoremap <silent> <Plug>(qf_qf_previous) :<C-u> call qf#wrap#WrapCommand('up', 'c', v:count1)<CR>
nnoremap <silent> <Plug>(qf_qf_next) :<C-u> call qf#wrap#WrapCommand('down', 'c', v:count1)<CR>

" Go up and down location list
nnoremap <silent> <Plug>(qf_loc_previous) :<C-u> call qf#wrap#WrapCommand('up', 'l')<CR>
nnoremap <silent> <Plug>(qf_loc_next) :<C-u> call qf#wrap#WrapCommand('down', 'l')<CR>
nnoremap <silent> <Plug>(qf_loc_previous) :<C-u> call qf#wrap#WrapCommand('up', 'l', v:count1)<CR>
nnoremap <silent> <Plug>(qf_loc_next) :<C-u> call qf#wrap#WrapCommand('down', 'l', v:count1)<CR>

" Toggle quickfix list
nnoremap <silent> <Plug>(qf_qf_toggle) :<C-u> call qf#toggle#ToggleQfWindow(0)<CR>
Expand Down