From a4bce02bf854e043da77a18f5cdf74543c7115ec Mon Sep 17 00:00:00 2001 From: bhagwan Date: Tue, 30 Apr 2024 08:46:05 -0400 Subject: [PATCH] fix(docs): more duplicate tags in OPTIONS.md (#1165) --- OPTIONS.md | 16 ++++------------ doc/fzf-lua-opts.txt | 26 +++++++------------------- lua/fzf-lua/cmp_src.lua | 3 ++- 3 files changed, 13 insertions(+), 32 deletions(-) diff --git a/OPTIONS.md b/OPTIONS.md index 8c8fc3d6..c6d82893 100644 --- a/OPTIONS.md +++ b/OPTIONS.md @@ -14,7 +14,7 @@ add to this document.** - [Pickers](#pickers) + [Buffers and Files](#buffers-and-files) + [Search](#search) - + [Tags](#tags) + + [CTags](#ctags) + [Git](#git) + [LSP | Diagnostics](#lspdiagnostics) + [Misc](#misc) @@ -682,11 +682,7 @@ Alias to `:FzfLua grep resume=true` #### grep_cword -Grep word under cursor - -#### grep_cWORD - -Grep WORD under cursor +Grep word/WORD under cursor #### grep_visual @@ -702,7 +698,7 @@ Grep on current buffer only --- -### Tags +### CTags #### tags @@ -722,11 +718,7 @@ Search current buffer ctags #### tags_grep_cword -Tags-Grep word under cursor - -#### tags_grep_cWORD - -Tags-Grep WORD under cursor +Tags-Grep word/WORD under cursor #### tags_grep_visual diff --git a/doc/fzf-lua-opts.txt b/doc/fzf-lua-opts.txt index eb41b6f5..1ca27419 100644 --- a/doc/fzf-lua-opts.txt +++ b/doc/fzf-lua-opts.txt @@ -9,7 +9,7 @@ Global Options ................................. |fzf-lua-opts-global-options| Pickers ............................................... |fzf-lua-opts-pickers| Buffers and Files ........................... |fzf-lua-opts-buffers-and-files| Search ................................................. |fzf-lua-opts-search| -Tags ..................................................... |fzf-lua-opts-tags| +CTags ................................................... |fzf-lua-opts-ctags| Git ....................................................... |fzf-lua-opts-git| LSP/Diagnostics ............................... |fzf-lua-opts-lsp/diagnostics| Misc ..................................................... |fzf-lua-opts-misc| @@ -35,9 +35,9 @@ FZF-LUA COMMANDS AND OPTIONS *fzf-lua-opts-fzf-lua-commands-and-options* - Setup Options <#setup-options> - Global Options <#global-options> - Pickers <#pickers> + Buffers and Files <#buffers-and-files> + Search - <#search> + Tags <#tags> + Git <#git> + LSP | Diagnostics <#lspdiagnostics> - + Misc <#misc> + Neovim API <#neovim-api> + `nvim-dap` <#nvim-dap> + `tmux` - <#tmux> + Completion Functions <#completion-functions> + <#search> + CTags <#ctags> + Git <#git> + LSP | Diagnostics + <#lspdiagnostics> + Misc <#misc> + Neovim API <#neovim-api> + `nvim-dap` + <#nvim-dap> + `tmux` <#tmux> + Completion Functions <#completion-functions> ------------------------------------------------------------------------------ GENERAL USAGE *fzf-lua-opts-general-usage* @@ -934,13 +934,7 @@ Alias to `:FzfLua grep resume=true` grep_cword *fzf-lua-opts-grep_cword* -Grep word under cursor - - - -grep_cWORD *fzf-lua-opts-grep_cword* - -Grep WORD under cursor +Grep word/WORD under cursor @@ -962,7 +956,7 @@ lgrep_curbuf *fzf-lua-opts-lgrep_curbuf* -TAGS *fzf-lua-opts-tags* +CTAGS *fzf-lua-opts-ctags* @@ -992,13 +986,7 @@ tags_live_grep *fzf-lua-opts-tags_live_grep* tags_grep_cword *fzf-lua-opts-tags_grep_cword* -Tags-Grep word under cursor - - - -tags_grep_cWORD *fzf-lua-opts-tags_grep_cword* - -Tags-Grep WORD under cursor +Tags-Grep word/WORD under cursor diff --git a/lua/fzf-lua/cmp_src.lua b/lua/fzf-lua/cmp_src.lua index db8c2653..88f1490f 100644 --- a/lua/fzf-lua/cmp_src.lua +++ b/lua/fzf-lua/cmp_src.lua @@ -35,7 +35,8 @@ end function Src:_get_documentation(completion_item) local options_md = require("fzf-lua.cmd").options_md() if not options_md or vim.tbl_isempty(options_md) then return end - local markdown = options_md[completion_item.label] + -- Test for `label:lower()` to match both `grep_c{word|WORD}` + local markdown = options_md[completion_item.label] or options_md[completion_item.label:lower()] if not markdown and completion_item.data then -- didn't find matching the label directly, search globals -- this will match "winopts.row" as "globals.winopts.row"