mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-01-30 14:45:30 +08:00
[Helptags] add preview window to :Helptags command (#1357)
+ In `fzf#vim#helptags`, we now also parse out the ex-command in the perl script so it's available for the preview (this is just an extra `\t(.*)` appended to the original regex). + Add the `--tag` placeholder to `:Helptags` with corresponding arguments.
This commit is contained in:
committed by
GitHub
parent
d6aa21476b
commit
66cb8b8264
@@ -1087,12 +1087,13 @@ function! fzf#vim#helptags(...)
|
||||
silent! call delete(s:helptags_script)
|
||||
endif
|
||||
let s:helptags_script = tempname()
|
||||
call writefile(['/('.(s:is_win ? '^[A-Z]:[\/\\].*?[^:]' : '.*?').'):(.*?)\t(.*?)\t/; printf(qq('.s:green('%-40s', 'Label').'\t%s\t%s\n), $2, $3, $1)'], s:helptags_script)
|
||||
|
||||
call writefile(['/('.(s:is_win ? '^[A-Z]:[\/\\].*?[^:]' : '.*?').'):(.*?)\t(.*?)\t(.*)/; printf(qq('.s:green('%-40s', 'Label').'\t%s\t%s\t%s\n), $2, $3, $1, $4)'], s:helptags_script)
|
||||
return s:fzf('helptags', {
|
||||
\ 'source': 'grep -H ".*" '.join(map(tags, 'fzf#shellescape(v:val)')).
|
||||
\ 'source': 'grep --with-filename ".*" '.join(map(tags, 'fzf#shellescape(v:val)')).
|
||||
\ ' | perl -n '.fzf#shellescape(s:helptags_script).' | sort',
|
||||
\ 'sink': s:function('s:helptag_sink'),
|
||||
\ 'options': ['--ansi', '+m', '--tiebreak=begin', '--with-nth', '..-2']}, a:000)
|
||||
\ 'options': ['--ansi', '+m', '--tiebreak=begin', '--with-nth', '..3']}, a:000)
|
||||
endfunction
|
||||
|
||||
" ------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user