ALEFindReferences: add -fzf flag to show output in fzf (#5018)

* references: add ALEFindReferences -fzf option

Allows using -fzf to show previews using fzf.vim. Includes:

- add support for opening in bufers, splits, tabs and for adding matches quickfix
- add support for -relative
- add fzf preview `--highlight-line` option
- add fzf.vim autoload module

* tests: fix references tests for fzf support update
This commit is contained in:
bretello
2025-12-21 05:06:34 +01:00
committed by GitHub
parent fa3d4f2f13
commit dd6e6f1b15
4 changed files with 154 additions and 31 deletions

View File

@@ -2280,6 +2280,16 @@ g:ale_references_show_contents
If set to `true` or `1`, matches found by `:ALEFindReferences` will be
shown with a preview of the matching line.
*ale-options.references_use_fzf*
*g:ale_references_use_fzf*
references_use_fzf
g:ale_references_use_fzf
Type: |Boolean| or |Number|
Default: `false`
If set to `true` or `1`, matches found by `:ALEFindReferences` will be
always shown using |fzf-vim| (https://github.com/junegunn/fzf.vim).
*ale-options.rename_tsserver_find_in_comments*
*g:ale_rename_tsserver_find_in_comments*
rename_tsserver_find_in_comments
@@ -4085,6 +4095,7 @@ documented in additional help files.
`:ALEFindReferences -vsplit` - Open the location in a vertical split.
`:ALEFindReferences -quickfix` - Put the locations into quickfix list.
`:ALEFindReferences -contents` - Show line contents for matches.
`:ALEFindReferences -fzf` - Show matches/previews using |fzf-vim|.
The default method used for navigating to a new location can be changed
by modifying |g:ale_default_navigation|.
@@ -4092,6 +4103,11 @@ documented in additional help files.
The default behaviour on whether to show line content for matches can
be changed by modifying |g:ale_references_show_contents|.
The default behaviour on whether to use `fzf` to show matches/file previews
can be changed by modifying |g:ale_references_use_fzf|. `-fzf` can be combined
with `-tab`, `-split`, `-vsplit`, `-quickfix` and `-relative`, while line
contents/file previews are always shown.
You can add `-relative` to the command to view results with relatives paths,
instead of absolute paths. This option has no effect if `-quickfix` is used.