summaryrefslogtreecommitdiffstats
path: root/src/cmdexpand.c
AgeCommit message (Collapse)Author
2024-01-04patch 9.1.0010: Keymap completion is not availablev9.1.0010Doug Kearns
Problem: Keymap completion is not available Solution: Add keymap completion (Doug Kearns) Add keymap completion to the 'keymap' option, user commands and builtin completion functions. closes: #13692 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-17patch 9.0.2037: A few remaining cmdline completion issues with C-E/Yv9.0.2037Yee Cheng Chin
Problem: A few remaining cmdline completion issues with C-E/Y Solution: Fix cmdline completion fuzzy/Ctrl-E/Ctrl-Y/options when not used at the end Fix cmdline completion fuzzy/Ctrl-E/Ctrl-Y/options when not used at the end A few places in the cmdline completion code only works properly when the user hits Tab (or 'wildchar') at the end of the cmdline, even though it's supposed to work even in the middle of the line. For fuzzy search, `:e ++ff`, and `:set hl=`, fix completion code to make sure to use `xp_pattern_len` instead of assuming the entire `xp_pattern` is the search pattern (since it contains texts after the cursor). Fix Ctrl-E / Ctrl-Y to not jump to the end when canceling/accepting a wildmenu completion. Also, make them work even when not using `set wildoptions+=pum` as there is no drawback to doing so. (Related issue where this was brought up: #13331) closes: #13362 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-14patch 9.0.2025: no cmdline completion for ++opt argsv9.0.2025Yee Cheng Chin
Problem: no cmdline completion for ++opt args Solution: Add cmdline completion for :e ++opt=arg and :terminal [++options] closes: #13319 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-10-09patch 9.0.2009: cmdline-completion for comma-separated options wrongv9.0.2009Yee Cheng Chin
Problem: cmdline-completion for comma-separated options wrong Solution: Fix command-line expansions for options with filenames with commas Fix command-line expansions for options with filenames with commas Cmdline expansion for option values that take a comma-separated list of file names is currently not handling file names with commas as the commas are not escaped. For such options, the commas in file names need to be escaped (to differentiate from a comma that delimit the list items). The escaped comma is unescaped in `copy_option_part()` during option parsing. Fix as follows: - Cmdline completion for option values with comma-separated file/folder names will not start a new match when seeing `\\,` and will instead consider it as one value. - File/folder regex matching will strip the `\\` when seeing `\\,` to make sure it can match the correct files/folders. - The expanded value will escape `,` with `\\,`, similar to how spaces are escaped to make sure the option value is correct on the cmdline. This fix also takes into account the fact that Win32 Vim handles file name escaping differently. Typing '\,' for a file name results in it being handled literally but in other platforms '\,' is interpreted as a simple ',' and commas need to be escaped using '\\,' instead. Also, make sure this new logic only applies to comma-separated options like 'path'. Non-list options like 'set makeprg=<Tab>' and regular ex commands like `:edit <Tab>` do not require escaping and will continue to work. Also fix up documentation to be clearer. The original docs are slightly misleading in how it discusses triple slashes for 'tags'. closes: #13303 related: #13301 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-09-29patch 9.0.1958: cannot complete option valuesv9.0.1958Yee Cheng Chin
Problem: cannot complete option values Solution: Add completion functions for several options Add cmdline tab-completion for setting string options Add tab-completion for setting string options on the cmdline using `:set=` (along with `:set+=` and `:set-=`). The existing tab completion for setting options currently only works when nothing is typed yet, and it only fills in with the existing value, e.g. when the user does `:set diffopt=<Tab>` it will be completed to `set diffopt=internal,filler,closeoff` and nothing else. This isn't too useful as a user usually wants auto-complete to suggest all the possible values, such as 'iblank', or 'algorithm:patience'. For set= and set+=, this adds a new optional callback function for each option that can be invoked when doing completion. This allows for each option to have control over how completion works. For example, in 'diffopt', it will suggest the default enumeration, but if `algorithm:` is selected, it will further suggest different algorithm types like 'meyers' and 'patience'. When using set=, the existing option value will be filled in as the first choice to preserve the existing behavior. When using set+= this won't happen as it doesn't make sense. For flag list options (e.g. 'mouse' and 'guioptions'), completion will take into account existing typed values (and in the case of set+=, the existing option value) to make sure it doesn't suggest duplicates. For set-=, there is a new `ExpandSettingSubtract` function which will handle flag list and comma-separated options smartly, by only suggesting values that currently exist in the option. Note that Vim has some existing code that adds special handling for 'filetype', 'syntax', and misc dir options like 'backupdir'. This change preserves them as they already work, instead of converting to the new callback API for each option. closes: #13182 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-09-29patch 9.0.1956: Custom completion skips orig cmdline if it invokes glob()v9.0.1956zeertzjq
Problem: Custom cmdline completion skips original cmdline when pressing Ctrl-P at first match if completion function invokes glob(). Solution: Move orig_save into struct expand_T. closes: #13216 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-27patch 9.0.1795: Indentation issuesv9.0.1795Yegappan Lakshmanan
Problem: Indentation issues Solution: Fix code indentation issues. closes: #12906 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-20patch 9.0.1774: no support for custom cmdline completionv9.0.1774Shougo Matsushita
Problem: no support for custom cmdline completion Solution: Add new vimscript functions Add the following two functions: - getcmdcompltype() returns custom and customlist functions - getcompletion() supports both custom and customlist closes: #12228 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2023-08-17patch 9.0.1735: Rename completion specific findex varv9.0.1735zeertzjq
Problem: Rename completion specific findex var Solution: Move "findex" static variable to xp_selected in expand_T closes: #12548 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-15patch 9.0.1714: getcompletion() "cmdline" fails after :autocmdv9.0.1714zeertzjq
Problem: getcompletion() "cmdline" fails after :autocmd Solution: Use set_cmd_context() instead of set_one_cmd_context(). closes: #12804 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-06-15patch 9.0.1636: expanding a pattern interferes with cmdline completionv9.0.1636zeertzjq
Problem: Expanding a pattern interferes with command line completion. Solution: Set the file index only when appropriate. (closes #12519)
2023-05-20patch 9.0.1571: RedrawingDisabled not used consistentlyv9.0.1571Bram Moolenaar
Problem: RedrawingDisabled not used consistently. Solution: Avoid RedrawingDisabled going negative. Set RedrawingDisabled in win_split_ins(). (closes #11961)
2023-05-06patch 9.0.1520: completion for option name includes all bool optionsv9.0.1520Bram Moolenaar
Problem: Completion for option name includes all bool options. Solution: Do not recognize the "noinv" prefix. Prefix "no" or "inv" when appropriate.
2023-04-22patch 9.0.1479: small source file problems; outdated list of distrib. filesv9.0.1479Bram Moolenaar
Problem: Small source file problems; outdated list of distributed files. Solution: Small updates to source files and list of distributed files.
2023-01-25patch 9.0.1242: code for :runtime completion is not consistentv9.0.1242zeertzjq
Problem: Code for :runtime completion is not consistent. Solution: Make code for cmdline expansion more consistent. (closes #11875)
2023-01-24patch 9.0.1238: :runtime completion can be further improvedv9.0.1238zeertzjq
Problem: :runtime completion can be further improved. Solution: Also complete the {where} argument values and adjust the completion for that. (closes #11874)
2023-01-22patch 9.0.1231: completion of :runtime does not handle {where} argumentv9.0.1231zeertzjq
Problem: Completion of :runtime does not handle {where} argument. Solution: Parse the {where} argument. (closes #11863)
2023-01-21patch 9.0.1227: no cmdline completion for :runtimev9.0.1227root
Problem: No cmdline completion for :runtime. Solution: Add completion for :runtime. (closes #11853, closes #11447) Improve the resulting matches.
2023-01-09patch 9.0.1166: code is indented more than necessaryv9.0.1166Yegappan Lakshmanan
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes #11792)
2022-12-10patch 9.0.1043: macro has confusing name and is duplicatedv9.0.1043zeertzjq
Problem: Macro has confusing name and is duplicated. Solution: Use one macro with an understandable name. (closes #11686)
2022-12-08patch 9.0.1030: using freed memory with the cmdline popup menuv9.0.1030Bram Moolenaar
Problem: Using freed memory with the cmdline popup menu. Solution: Clear the popup menu when clearing the matches. (closes #11677)
2022-11-14patch 9.0.0883: a silent mapping may cause dots on the command linev9.0.0883Bram Moolenaar
Problem: A silent mapping may cause dots on the command line. Solution: Don't show dots for completion if they are not going to be removed again. (closes #11501)
2022-11-14patch 9.0.0880: preprocessor indenting is offv9.0.0880K.Takata
Problem: Preprocessor indenting is off. Solution: Adjust preprocessor indentation. (Ken Takata, closes #11546)
2022-11-13patch 9.0.0876: code is indented more than neededv9.0.0876Yegappan Lakshmanan
Problem: Code is indented more than needed. Solution: Split ExpandEscape() in two. (Yegappan Lakshmanan, closes #11539)
2022-11-12patch 9.0.0867: wildmenu redrawing code is spread outv9.0.0867Bram Moolenaar
Problem: Wildmenu redrawing code is spread out. Solution: Refactor to move code together. (closes #11528)
2022-09-18patch 9.0.0498: various small issuesv9.0.0498Bram Moolenaar
Problem: Various small issues. Solution: Various small fixes.
2022-09-02patch 9.0.0359: error message for wrong argument type is not specificv9.0.0359Yegappan Lakshmanan
Problem: Error message for wrong argument type is not specific. Solution: Include more information in the error. (Yegappan Lakshmanan, closes #11037)
2022-09-01patch 9.0.0346: :horizontal modifier not fully supportedv9.0.0346zeertzjq
Problem: :horizontal modifier not fully supported. Solution: Also use :horizontal for completion and user commands. (closes #11025)
2022-08-26patch 9.0.0281: build failure without the +eval featurev9.0.0281Bram Moolenaar
Problem: Build failure without the +eval feature. Solution: Add #ifdef.
2022-08-26patch 9.0.0279: the tiny version has the popup menu but not 'wildmenu'v9.0.0279Bram Moolenaar
Problem: The tiny version has the popup menu but not 'wildmenu'. Solution: Graduate the wildmenu feature.
2022-08-21patch 9.0.0236: popup menu not removed when 'wildmenu' reset while visiblev9.0.0236zeertzjq
Problem: Popup menu not removed when 'wildmenu' reset while it is visible. Solution: Do not check p_wmnu, only pum_visible(). (closes #10953)
2022-08-20patch 9.0.0231: expanding "**" may loop forever with directory linksv9.0.0231Bram Moolenaar
Problem: Expanding "**" may loop forever with directory links. Solution: Check for being interrupted. (closes #10946)
2022-08-14patch 9.0.0206: redraw flags are not named specificallyv9.0.0206Bram Moolenaar
Problem: Redraw flags are not named specifically. Solution: Prefix "UPD_" to the flags, for UPDate_screen().
2022-07-26patch 9.0.0089: fuzzy argument completion doesn't work for shell commandsv9.0.0089Yegappan Lakshmanan
Problem: Fuzzy argument completion doesn't work for shell commands. Solution: Check for cmdidx not being CMD_bang. (Yegappan Lakshmanan, closes #10769)
2022-06-16patch 8.2.5107: some callers of rettv_list_alloc() check for not OKv8.2.5107Bram Moolenaar
Problem: Some callers of rettv_list_alloc() check for not OK. (Christ van Willegen) Solution: Use "==" instead of "!=" when checking the return value.
2022-05-08patch 8.2.4917: fuzzy expansion of option names is not rightv8.2.4917Christian Brabandt
Problem: Fuzzy expansion of option names is not right. Solution: Pass the fuzzy flag down the call chain. (Christian Brabandt, closes #10380, closes #10318)
2022-05-07patch 8.2.4903: cannot get the current cmdline completion type and positionv8.2.4903Shougo Matsushita
Problem: Cannot get the current cmdline completion type and position. Solution: Add getcmdcompltype() and getcmdscreenpos(). (Shougo Matsushita, closes #10344)
2022-04-11patch 8.2.4738: Esc on commandline executes command instead of abandoning itv8.2.4738Bram Moolenaar
Problem: Esc on commandline executes command instead of abandoning it. Solution: Save and restore KeyTyped when removing the popup menu. (closes #10154)
2022-04-10patch 8.2.4732: duplicate code to free fuzzy matchesv8.2.4732Bram Moolenaar
Problem: Duplicate code to free fuzzy matches. Solution: Bring back fuzmatch_str_free().
2022-03-24patch 8.2.4617: no completion for :scriptnamesv8.2.4617Yegappan Lakshmanan
Problem: No completion for :scriptnames. Solution: Implement :scriptnames completion. (Yegappan Lakshmanan, closes #10005)
2022-03-22patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"v8.2.4608Yegappan Lakshmanan
Problem: getcompletion() does not work properly when 'wildoptions contains "fuzzy". Solution: Do not use addstar(). (Yegappan Lakshmanan, closes #9992, closes #9986)
2022-03-16patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menuv8.2.4579Yegappan Lakshmanan
Problem: Cannot use page-up and page-down in the command line completion popup menu. Solution: Check for to page-up and page-down keys. (Yegappan Lakshmanan, closes #9960)
2022-03-15patch 8.2.4570: no command line completion for :profile and :profdelv8.2.4570Yegappan Lakshmanan
Problem: No command line completion for :profile and :profdel. Solution: Implement completion. (Yegappan Lakshmanan, closes #9955)
2022-03-14patch 8.2.4565: no command line completion for :breakadd and :breakdelv8.2.4565Bram Moolenaar
Problem: No command line completion for :breakadd and :breakdel. Solution: Add completion for :breakadd and :breakdel. (Yegappan Lakshmanan, closes #9950)
2022-02-28patch 8.2.4485: compiler warning for uninitialized variablev8.2.4485Bram Moolenaar
Problem: Compiler warning for uninitialized variable. Solution: Initialize the variable. (John Marriott)
2022-02-28patch 8.2.4483: command completion makes two rounds to collect matchesv8.2.4483Yegappan Lakshmanan
Problem: Command completion makes two rounds to collect matches. Solution: Use a growarray to collect matches. (Yegappan Lakshmanan, closes #9860)
2022-02-27patch 8.2.4482: no fuzzy cmdline completion for user defined completionv8.2.4482Yegappan Lakshmanan
Problem: No fuzzy cmdline completion for user defined completion. Solution: Add fuzzy completion for user defined completion. (Yegappan Lakshmanan, closes #9858)
2022-02-27patch 8.2.4481: cmdline popup menu not removed when 'lazyredraw' is setv8.2.4481Bram Moolenaar
Problem: Cmdline popup menu not removed when 'lazyredraw' is set. Solution: Temporarily reset 'lazyredraw' when removing the popup menu. (closes #9857)
2022-02-27patch 8.2.4479: no fuzzy completieon for maps and abbreviationsv8.2.4479Yegappan Lakshmanan
Problem: No fuzzy completieon for maps and abbreviations. Solution: Fuzzy complete maps and abbreviations. (Yegappan Lakshmanan, closes #9856)
2022-02-26patch 8.2.4478: crash when using fuzzy completionv8.2.4478Yegappan Lakshmanan
Problem: Crash when using fuzzy completion. Solution: Temporary fix: put back regexp. (closes #9852, closes #9851)