Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PreviewFileUnderCursor() #112

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
call the autoload in qf#PreviewFileUnderCursor() duplicate
perelo committed Oct 31, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 3a9f9b2473f8f5d31f0409948761bd3c35a92a09
10 changes: 1 addition & 9 deletions autoload/qf.vim
Original file line number Diff line number Diff line change
@@ -21,15 +21,7 @@ set cpo&vim

" open the current entry in th preview window
function qf#PreviewFileUnderCursor()
let cur_list = b:qf_isLoc == 1 ? getloclist('.') : getqflist()
let cur_line = getline(line('.'))
let cur_file = fnameescape(substitute(cur_line, '|.*$', '', ''))
if cur_line =~ '|\d\+'
let cur_pos = substitute(cur_line, '^\(.\{-}|\)\(\d\+\)\(.*\)', '\2', '')
execute "pedit +" . cur_pos . " " . cur_file
else
execute "pedit " . cur_file
endif
call qf#preview#PreviewFileUnderCursor()
endfunction

" helper function