Commit Graph
6 Commits
Author SHA1 Message Date
Junegunn Choi 96c08602ac Sandbox the tag address in the preview too
A preview runs as soon as an entry is highlighted, so a crafted tags file did not
even need to be selected to get a shell command out of 'vim -c "silent {excmd}"'.
The address goes to ':execute' as a string literal with its quotes doubled, since
':sandbox' as a modifier would stop at the first '|'.

An entry with no address is refused rather than previewing the last line of the
file, which is where Ex mode leaves the cursor.
2026-09-28 22:50:14 +09:00
Junegunn Choi 6f28c8c7bb [Tags] Fix preview on Vim 9.1
Fix #1555
2024-08-01 15:20:41 +09:00
Nicolas e0d131d953 tagpreview: open vim in readonly mode, and exit on failure (#1488)
- When computing the center line, 'exit' on failure instead of 'return'.
- Open vim in read-only mode to avoid a non-zero exit code if the file is
already opened.

Signed-off-by: Nicolas VINCENT <nico.vince@gmail.com>
2023-07-17 18:57:01 +09:00
Greg Fisher 1ef72b14cc Use nvim if vim not installed (#1262)
The `tagpreview.sh` script is hardcoded to the `vim` binary. For users that only
have  Neovim installed an error is displayed and no preview is rendered.

This change addresses this by falling back to the `nvim` binary if the `vim`
binary isn't present.
2021-03-14 12:08:29 +09:00
Ingo Meyer 36de5db9f0 [Tagpreview] Handle absolute file paths correctly (#1229)
Fix #1228
2021-01-20 20:34:56 +09:00
1fcdee55cc [Tags] Add a tag preview with a custom tagpreview.sh script (#1223)
* Add a tag preview with a custom `tagpreview.sh` script

* [Tags] Respect g:fzf_preview_window

Co-authored-by: Ingo Meyer <IJ_M@gmx.de>
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2021-01-17 22:36:02 +09:00