summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_cmdline.vim
AgeCommit message (Collapse)Author
2024-06-18patch 9.1.0498: getcmdcompltype() interferes with cmdline completionv9.1.0498zeertzjq
Problem: getcmdcompltype() interferes with cmdline completion. Solution: Don't set expand context when it's already set. (zeertzjq) closes: #15036 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-17patch 9.1.0495: Matched text isn't highlighted in cmdline pumv9.1.0495zeertzjq
Problem: Matched text isn't highlighted in cmdline pum. Solution: Use cmdline completion pattern in cmdline mode. (zeertzjq) closes: #15029 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-15patch 9.1.0491: Cmdline pum doesn't work properly with 'rightleft'v9.1.0491zeertzjq
Problem: Cmdline pum doesn't work properly with 'rightleft'. Solution: Don't use curwin->w_p_rl in cmdline mode in pum_redraw(). Use a static variable since pum_may_redraw() may be called in any mode. Also correct position of other popups with 'rightleft'. (zeertzjq) closes: #15005 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-15patch 9.1.0332: tests: some assert_equal() calls have wrong order of argsv9.1.0332zeertzjq
Problem: tests: some assert_equal() calls have wrong order of args Solution: Correct the order (zeertzjq). closes: #14555 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-14patch 9.1.0328: CI fails with t_?? testv9.1.0328Christian Brabandt
Problem: CI fails with t_?? test Solution: use assert_match instead of assert_equal and test only until t_xo, depending on system there may be several more termcap codes coming Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-14patch 9.1.0321: Garbled output on serial terminals with XON/XOFF flow controlv9.1.0321Anton Sharonov
Problem: When used terminal with XON/XOFF flow control, vim tries to still make CTRL-S mapping available, which results in severe screen corruption, especially on large redraws, and even spurious inputs (John Tsiombikas) Solution: Disallow CTRL-S mapping if such terminal is recognized. Don't remove IXON from the bitmask inversion. (Anton Sharonov) *** When started like this: TERM=vt420 vim :set termcap shows "t_xon=y" map <C-S> :echo "abc"<CR> does nothing (after <C-S> output freezes and subsequent <C-Q> unfreezes it) *** When started like this: TERM=xterm vim :set termcap shows "t_xon=" map <C-S> :echo "abc"<CR> works (after <C-S> one see "abc" string echo-ed) fixes: #12674 closes: #14542 Signed-off-by: Anton Sharonov <anton.sharonov@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-26patch 9.1.0137: <Del> in cmdline mode doesn't delete composing charsv9.1.0137zeertzjq
Problem: <Del> in cmdline mode doesn't delete composing chars Solution: Use mb_head_off() and mb_ptr2len() (zeertzjq) closes: #14095 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-24patch 9.1.0131: buffer-completion may not always find all matchesv9.1.0131Christian Brabandt
Problem: buffer-completion code too complicated and does not always find all matches (irisjae) Solution: do not try to anchor pattern to beginning of line or directory-separator, always return all matches Note: we are considering the non-fuzzy buffer-matching here. Currently, the buffer-completion code makes 2 attempts to match a pattern against the list of available patterns. First try is to match the pattern and anchor it to either the beginning of the file name or at a directory-separator (// or \\). When a match is found, Vim returns the matching buffers and does not try to find a match anywhere within a buffer name. So if you have opened two buffers like /tmp/Foobar.c and /tmp/MyFoobar.c using `:b Foo` will only complete to the first filename, but not the second (the same happens with `getcompletion('Foo', 'buffer')`). It may make sense, that completion priorities buffer names at directory boundaries, but it inconsistent, may cause confusion why a certain buffer name is not completed when typing `:b Foo<C-D>` which returns only a single file name and then pressing Enter (to switch to that buffer), Vim will error with 'E93: More than one match for Foo'). Similar things may happen when wiping the /tmp/Foobar.c pattern and afterwards the completion starts completing other buffers. So let's simplify the code and always match the pattern anywhere in the buffer name, do not try to favor matches at directory boundaries. This is also simplifies the code a bit, we do not need to run over the list of buffers several times, but only twice. fixes #13894 closes: #14082 Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-12patch 9.1.0019: cmdline may disappear when changing 'cmdheight'v9.1.0019Christian Brabandt
Problem: cmdline may disappear when changing 'cmdheight' (after Patch 9.0.0190, @markonm) Solution: always re-calculate the old_p_ch value, not only when cmdline_row was higher than expected fixes: #13822 closes: #13826 Signed-off-by: Christian Brabandt <cb@256bit.org>
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-17patch 9.0.2035: [security] use-after-free with wildmenuv9.0.2035Yee Cheng Chin
Problem: [security] use-after-free with wildmenu Solution: properly clean up the wildmenu when exiting Fix wildchar/wildmenu/pum memory corruption with special wildchar's Currently, using `wildchar=<Esc>` or `wildchar=<C-\>` can lead to a memory corruption if using wildmenu+pum, or wrong states if only using wildmenu. This is due to the code only using one single place inside the cmdline process loop to perform wild menu clean up (by checking `end_wildmenu`) but there are other odd situations where the loop could have exited and we need a post-loop clean up just to be sure. If the clean up was not done you would have a stale popup menu referring to invalid memory, or if not using popup menu, incorrect status line (if `laststatus=0`). For example, if you hit `<Esc>` two times when it's wildchar, there's a hard-coded behavior to exit command-line as a failsafe for user, and if you hit `<C-\><C-\><C-N>` it will also exit command-line, but the clean up code would not have hit because of specialized `<C-\>` handling. Fix Ctrl-E / Ctrl-Y to not cancel/accept wildmenu if they are also used for 'wildchar'/'wildcharm'. Currently they don't behave properly, and also have potentially memory unsafe behavior as the logic is currently not accounting for this situation and try to do both. (Previous patch that addressed this: #11677) Also, correctly document Escape key behavior (double-hit it to escape) in wildchar docs as it's previously undocumented. In addition, block known invalid chars to be set in `wildchar` option, such as Ctrl-C and `<CR>`. This is just to make it clear to the user they shouldn't be set, and is not required for this bug fix. closes: #13361 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.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-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-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-08-13patch 9.0.1708: getcompletion() failes for user-defined commandsv9.0.1708Christian Brabandt
Problem: getcompletion() failes for user-defined commands Solution: set context for completion function closes: #12681 closes: #12680 Signed-off-by: Christian Brabandt <cb@256bit.org>
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-19patch 9.0.1570: some tests are slowv9.0.1570Bram Moolenaar
Problem: Some tests are slow. Solution: Make a few test cases faster.
2023-04-17patch 9.0.1461: ruler not drawn correctly when using 'rulerformat'v9.0.1461Sean Dewar
Problem: Ruler not drawn correctly when using 'rulerformat'. Solution: Adjust formatting depending on whether the ruler is drawn in the statusline or the command line. (Sean Dewar, closes #12246)
2023-04-17patch 9.0.1460: insufficient testing for getcmdcompltype()v9.0.1460zeertzjq
Problem: Insufficient testing for getcmdcompltype(). Solution: Add a few more test cases. (closes #12268)
2023-04-12patch 9.0.1444: crash when passing NULL to setcmdline()v9.0.1444zeertzjq
Problem: Crash when passing NULL to setcmdline(). (Andreas Louv) Solution: Use tv_get_string() instead of using v_string directly. (closes #12231, closes #12227)
2023-02-17patch 9.0.1315: escaping for completion of map command not properly testedv9.0.1315zeertzjq
Problem: Escaping for completion of map command not properly tested. Solution: Add a few test cases. (closes #12009)
2023-02-05patch 9.0.1285: various small problemsv9.0.1285Bram Moolenaar
Problem: Various small problems. Solution: Adjust white space and comments.
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-22patch 9.0.1228: fuzzy menu completion is only tested in the GUIv9.0.1228zeertzjq
Problem: Fuzzy menu completion is only tested in the GUI. Solution: Make fuzzy menu completion test work without GUI. (closes #11861)
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-18patch 9.0.1218: completion includes functions that don't workv9.0.1218Kota Kato
Problem: Completion includes functions that don't work. Solution: Skip functions that are not implemented. (Kota Kato, closes #11845)
2023-01-04patch 9.0.1148: cmdline test fails in the GUIv9.0.1148Bram Moolenaar
Problem: Cmdline test fails in the GUI. Solution: Skip the test when running in the GUI.
2023-01-04patch 9.0.1144: reading beyond textv9.0.1144Bram Moolenaar
Problem: Reading beyond text. Solution: Add strlen_maxlen() and use it.
2022-12-08patch 9.0.1032: test fails when terminal feature is missingv9.0.1032Bram Moolenaar
Problem: Test fails when terminal feature is missing. Solution: Use CheckRunVimInTerminal.
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-08patch 9.0.0845: shell command with just space gives strange errorv9.0.0845shane.xb.qian
Problem: Shell command with just space gives strange error. Solution: Skip white space at start of the argument. (Christian Brabandt, Shane-XB-Qian, closes #11515, closes #11495)
2022-10-06patch 9.0.0670: no space for command line when there is a tablinev9.0.0670Bram Moolenaar
Problem: No space for command line when there is a tabline. Solution: Correct computation of where the command line should be. (closes #11295)
2022-10-05patch 9.0.0665: setting 'cmdheight' has no effect if last window was resizedv9.0.0665Bram Moolenaar
Problem: Setting 'cmdheight' has no effect if last window was resized. Solution: Do apply 'cmdheight' when told to. Use the frame height instead of the cmdline_row. (closes #11286)
2022-09-20patch 9.0.0517: when at the command line :redrawstatus does not work wellv9.0.0517zeertzjq
Problem: When at the command line :redrawstatus does not work well. Solution: Only update the statuslines instead of the screen. (closes #11180)
2022-09-20patch 9.0.0512: cannot redraw the status lines when editing a commandv9.0.0512zeertzjq
Problem: Cannot redraw the status lines when editing a command. Solution: Only postpone the redraw when messages have scrolled. (closes #11170)
2022-09-19patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChangedv9.0.0507Bram Moolenaar
Problem: Command line cleared when using :redrawstatus in CmdlineChanged autocommand event. Solution: Postpone the redraw. (closes #11162)
2022-09-15patch 9.0.0473: fullcommand() only works for the current script versionv9.0.0473Bram Moolenaar
Problem: fullcommand() only works for the current script version. Solution: Add an optional argument for the script version.
2022-09-14patch 9.0.0463: command line test leaves directory behindv9.0.0463Dominique Pelle
Problem: Command line test leaves directory behind. Solution: Use the "R" flag on the first mkdir(). (Dominique Pellé, closes #11127)
2022-09-08patch 9.0.0418: manually deleting temp test filesv9.0.0418Bram Moolenaar
Problem: Manually deleting temp test files. Solution: Use the 'D' flag of writefile() and mkdir().
2022-09-02patch 9.0.0362: expanding ":e %" does not work for remote filesv9.0.0362Bram Moolenaar
Problem: Expanding ":e %" does not work for remote files. Solution: If the "%" or "#" file does not exist add the expansion anyway.
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-30patch 9.0.0336: tests are flaky because of using a common file namev9.0.0336Bram Moolenaar
Problem: Tests are flaky because of using a common file name. Solution: Rename files and directories to be more unique.
2022-08-29patch 9.0.0323: using common name in tests leads to flaky testsv9.0.0323Bram Moolenaar
Problem: Using common name in tests leads to flaky tests. Solution: Rename files and directories to be more specific.
2022-08-29patch 9.0.0320: command line type of CmdlineChange differs from getcmdtype()v9.0.0320zeertzjq
Problem: Command line type of CmdlineChange differs from getcmdtype(). Solution: Use the same type. (closes #11005)
2022-08-28patch 9.0.0299: error messages for setcmdline() could be betterv9.0.0299Yegappan Lakshmanan
Problem: Error messages for setcmdline() could be better. Solution: Use more specific error messages. (Yegappan Lakshmanan, closes #10995)
2022-08-27patch 9.0.0285: it is not easy to change the command line from a pluginv9.0.0285Shougo Matsushita
Problem: It is not easy to change the command line from a plugin. Solution: Add setcmdline(). (Shougo Matsushita, closes #10869)