aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
...
* vim-patch:8.2.4497: wrong color for half of wide character next to pum ↵zeertzjq2023-10-18
| | | | | | | | | | scrollbar (#25693) Problem: Wrong color for half of wide character next to pum scrollbar. Solution: Redraw the screen cell with the right color. (closes vim/vim#9874) https://github.com/vim/vim/commit/35d8c2010ea6ee5c9bcfa6a8285648172b92ed83 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.2041: trim(): hard to use default mask (#25692)zeertzjq2023-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: trim(): hard to use default mask (partly revert v9.0.2040) Solution: use default mask when it is empty The default 'mask' value is pretty complex, as it includes many characters. Yet, if one needs to specify the trimming direction, the third argument, 'trim()' currently requires the 'mask' value to be provided explicitly. Currently, an empty 'mask' will make 'trim()' call return 'text' value that is passed in unmodified. It is unlikely that someone is using it, so the chances of scripts being broken by this change are low. Also, this reverts commit 9.0.2040 (which uses v:none for the default and requires to use an empty string instead). closes: vim/vim#13358 https://github.com/vim/vim/commit/8079917447e7436dccc2e4cd4a4a56ae0a4712f2 vim-patch:9.0.2040: trim(): hard to use default mask Problem: trim(): hard to use default mask Solution: Use default 'mask' when it is v:none The default 'mask' value is pretty complex, as it includes many characters. Yet, if one needs to specify the trimming direction, the third argument, 'trim()' currently requires the 'mask' value to be provided explicitly. 'v:none' is already used to mean "use the default argument value" in user defined functions. See |none-function_argument| in help. closes: vim/vim#13363 https://github.com/vim/vim/commit/6e6386716f9494ae86027c6d34f657fd03dfec42 Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
* vim-patch:9.0.2035: [security] use-after-free with wildmenu (#25687)zeertzjq2023-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: vim/vim#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: vim/vim#13361 https://github.com/vim/vim/commit/8f4fb007e4d472b09ff6bed9ffa485e0c3093699 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* vim-patch:9.0.2037: A few remaining cmdline completion issues with C-E/Y ↵zeertzjq2023-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#25686) 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: vim/vim#13331) closes: vim/vim#13362 https://github.com/vim/vim/commit/209ec90b9b9bd948d76511c9cd2b17f47a97afe6 Cherry-pick ex_getln.c changes from patch 9.0.2035. Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* vim-patch:9.0.2039: completion shows current word after completion restart ↵zeertzjq2023-10-17
| | | | | | | | | | | | | | | | | | (#25682) Problem: completion shows current word after completion restart Solution: remove the word being completed after completion restart The word being completed is shown in a completion list after completion restart, because it isn't removed from the current buffer before searching for matches. Also adjust `Test_complete_add_onechar` to match the new behavior. closes: vim/vim#13349 https://github.com/vim/vim/commit/2e3cd52fa02b1a208c97992b1bca3b04f7be66d4 Co-authored-by: nwounkn <nwounkn@gmail.com>
* refactor(options)!: make OptionSet `v:` values use typvalFamiu Haque2023-10-17
| | | | BREAKING CHANGE: This breaks the OptionSet autocommand, as the `v:` values associated with it (`v:option_new`, `v:option_old`, `v:option_oldlocal` and `v:option_oldglobal`) are now the same type as the option, instead of all option values being converted to strings.
* fix(extmarks): skip virt_text if it is out of window (#25658)zeertzjq2023-10-15
|
* vim-patch:9.0.2025: no cmdline completion for ++opt args (#25657)zeertzjq2023-10-15
| | | | | | | | | | | Problem: no cmdline completion for ++opt args Solution: Add cmdline completion for :e ++opt=arg and :terminal [++options] closes: vim/vim#13319 https://github.com/vim/vim/commit/989426be6e9ae23d2413943890206cbe15d9df38 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* vim-patch:9.0.2032: cannot get mouse click pos for tab or virt text (#25653)zeertzjq2023-10-15
| | | | | | | | | Problem: Cannot accurately get mouse clicking position when clicking on a TAB or with virtual text. Solution: Add a "coladd" field to getmousepos() result. closes: vim/vim#13335 https://github.com/vim/vim/commit/f5a94d5165bb9e390797da50a1fa7a87df3fbee4
* vim-patch:9.0.2031: TextChangedI may be triggered by non-insert mode change ↵zeertzjq2023-10-15
| | | | | | | | | | | | | | | (#25656) Problem: `TextChangedI` can trigger on entering Insert mode if there was previously a change not in Insert mode. Solution: Make it trigger only when text is actually changed in Insert mode. closes: vim/vim#13265 closes: vim/vim#13338 https://github.com/vim/vim/commit/d7ae263af8f6a2da55ce3702d18c53ab1418bca7 Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
* test(terminal/channel_spec): fix flakiness (#25649)zeertzjq2023-10-15
|
* vim-patch:9.0.2024: no filetype detection for Debian sourcesChristian Clason2023-10-14
| | | | | | | | | | | Problem: no filetype detection for Debian sources Solution: Add new deb822sources filetype closes: vim/vim#13320 https://github.com/vim/vim/commit/bd734c3bead9e167eb6875f62cc06fab2379c422 Co-authored-by: James McCoy <jamessan@jamessan.com>
* test(winscrolled): make sure floating window is drawn (#25639)zeertzjq2023-10-14
|
* vim-patch:9.0.2022: getmousepos() returns wrong index for TAB char (#25636)zeertzjq2023-10-14
| | | | | | | | | | | Problem: When clicking in the middle of a TAB, getmousepos() returns the column of the next char instead of the TAB. Solution: Break out of the loop when the vcol to find is inside current char. Fix invalid memory access when calling virtcol2col() on an empty line. closes: vim/vim#13321 https://github.com/vim/vim/commit/b583eda7031b1f6a3469a2537d0c10ca5fa5568e
* fix(lsp): refactor escaping snippet text (#25611)Maria José Solano2023-10-14
|
* fix(ui): empty line before the next message after :silent commandnwounkn2023-10-14
| | | | | | | | | | Problem: The next command after `silent !{cmd}` or `silent lua print('str')` prints an empty line before printing a message, because these commands set `msg_didout = true` despite not printing any messages. Solution: Set `msg_didout = true` only if `msg_silent == 0`
* test(ui/searchhl_spec): match more in :terminal test (#25631)zeertzjq2023-10-14
|
* vim-patch:8.1.0822: peeking and flushing output slows down execution (#25629)zeertzjq2023-10-14
| | | | | | | Problem: Peeking and flushing output slows down execution. Solution: Do not update the mode message when global_busy is set. Do not flush when only peeking for a character. (Ken Takata) https://github.com/vim/vim/commit/cb574f415486adff645ce384979bfecf27f5be8c
* fix(grid): add start column when getting char on line (#25627)zeertzjq2023-10-13
|
* fix: allow multiline message for echoerr (#25380)Jongwook Choi2023-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PROBLEM: Currently `:echoerr` prints multi-line strings in a single line as `:echom` does (Note: `:echon` can print multi-line strings well). This makes stacktrace printed via echoerr difficult to read. Example code: try lua error("lua stacktrace") catch echoerr v:exception endtry Output: Error detected while processing a.vim[5]..a.vim: line 4: Vim(lua):E5108: Error executing lua [string ":lua"]:1: lua stacktrace^@stack traceback:^@^I[C]: in function 'error'^@^I[string ":lua"]:1: in main chunk SOLUTION: Allow echoerr to print multiline messages (e.g., lua exceptions), because this command is usually used to print stacktraces. Output after the fix: Error detected while processing a.vim[5]..a.vim: line 4: Vim(lua):E5108: Error executing lua [string ":lua"]:1: lua stacktrace stack traceback: [C]: in function 'error' [string ":lua"]:1: in main chunk
* refactor(test): cleanup #25614Justin M. Keyes2023-10-12
| | | | | - unnecessary separate describe() group - clear() wasn't called in the describe() group - unnecessary indirection in function parameters
* feat(types): add `test/.luarc.json`L Lllvvuu2023-10-12
| | | | | Authored-By: Lewis Russell <lewis6991@gmail.com> Co-Authored-By: Lewis Russell <lewis6991@gmail.com>
* fix(lsp): handle NUL bytes in popup text (#25612)zeertzjq2023-10-12
| | | Fix #25610
* vim-patch:9.0.2018: complete_info() returns wrong index (#25607)zeertzjq2023-10-12
| | | | | | | | | | | | | | | | Problem: complete_info() returns wrong index Solution: Make order of 'info' in completion_info consistent Start the iteration from the same point and follow the same direction as done when assigning the completion numbers. This way we remove the dependence on the completion direction and make the order of 'info' consistent. closes: vim/vim#12230 closes: vim/vim#12971 https://github.com/vim/vim/commit/69fb5afb3bc9da24c2fb0eafb0027ba9c6502fc2 Co-authored-by: LemonBoy <thatlemon@gmail.com>
* vim-patch:8.2.3064: Vim9: in script cannot set item in uninitialized list ↵zeertzjq2023-10-12
| | | | | | | | | | (#25605) Problem: Vim9: in script cannot set item in uninitialized list. Solution: When a list is NULL allocate an empty one. (closes vim/vim#8461) https://github.com/vim/vim/commit/e65081d1b591f16dc6e380a830d87565c5eb7b03 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.2017: linebreak applies for leading whitespace (#25604)zeertzjq2023-10-12
| | | | | | | | | | | | Problem: linebreak applies for leading whitespace Solution: only apply linebreak, once we have found non-breakat chars in the line closes: vim/vim#13228 closes: vim/vim#13243 https://github.com/vim/vim/commit/dd75fcfbdff1934c6e531b5a89ebc636318bf4a2 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.0.2011: INI files not detectedChristian Clason2023-10-11
| | | | | | | | | | | | | | Problem: INI files not detected Solution: detect uppercase .INI as dosini files It previo~1 only worked for lower-case .ini files, but upperc~1 .INI is also somewhat common on account of DOS' old 8.3 upperc~2 only filena~1. closes: vim/vim#13316 https://github.com/vim/vim/commit/4a82bdfaa8022402b1ca0f0000c94c47a13f1014 Co-authored-by: Martin Tournoij <martin@arp242.net>
* refactor(float): rename ex_floatclose to ex_fclose (#25596)Raphael2023-10-11
|
* test(core/path_spec): don't use fnameescape() (#25593)zeertzjq2023-10-11
| | | | | Using fnameescape() for the path argument of findfile() and finddir() is wrong, as fnameescape() is intended to be used for parts of Ex commands, not function arguments.
* docs: small fixesdundargoc2023-10-10
| | | | | | Co-authored-by: Wansmer <wansmer@gmail.com> Co-authored-by: Andrew Voynov <andrewvoynov.b@gmail.com> Co-authored-by: David Moberg <david.moberg@mediatek.com>
* Merge pull request #25561 from glepnir/9663bfredl2023-10-10
|\ | | | | feat(float): add fclose command
| * feat(float): add fclose commandglepnir2023-10-10
| |
* | fix(highlight): add `FloatFooter` to 'highlight_defs.h' (#25577)Evgeni Chasnovski2023-10-10
| |
* | vim-patch:9.0.2009: cmdline-completion for comma-separated options wrong ↵zeertzjq2023-10-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#25569) 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: vim/vim#13303 related: vim/vim#13301 https://github.com/vim/vim/commit/54844857fd6933fa4f6678e47610c4b9c9f7a091 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* | fix(file_search): path with spaces in finddir() and findfile() (#25493)Leonardo Mello2023-10-10
| | | | | | Co-authored-by: dundargoc <gocdundar@gmail.com>
* | vim-patch:9.0.2008: test: undofile left behind (#25567)zeertzjq2023-10-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: test: undofile left behind Solution: cleanup undofile fix: tmp file not deleted when running make test_undo Temporary file `.Xtestfile.txt.un~` was left running `make test_undo` and vim was configured with: ``` ./configure --with-features=normal --enable-gui=no --enable-terminal ``` closes: vim/vim#13304 https://github.com/vim/vim/commit/b07b9dc4dafe2aad5ee752a51f06acacae210fef Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
* | fix(autocmd): API functions accept garbage after event name #25523ii142023-10-09
| | | | | | | | | | | | | | "VimEnter foo" was accepted as a valid event name for "VimEnter". Events delimited with commas, eg. "VimEnter,BufRead", were also accepted, even though only the first event was actually parsed. Co-authored-by: ii14 <ii14@users.noreply.github.com>
* | feat(ui-ext): make 'mousehide' into proper ui_option (#25532)Jaehoon Hwang2023-10-09
| |
* | test(ui/embed_spec): use notification instead of request (#25555)zeertzjq2023-10-09
| | | | | | This avoid the hang mentioned in #24888, and also matches TUI better.
* | Merge pull request #25503 from bfredl/unishapebfredl2023-10-08
|\ \ | |/ |/| refactor(grid): do arabic shaping in one place
| * refactor(grid): do arabic shaping in one placebfredl2023-10-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'arabicshape' feature of vim is a transformation of unicode text to make arabic and some related scripts look better at display time. In particular the content of a cell will be adjusted depending on the (original) content of the cells just before and after it. This is implemented by the arabic_shape() function in nvim. Before this commit, shaping was invoked in four different contexts: - when rendering buffer text in win_line() - in line_putchar() for rendering virtual text - as part of grid_line_puts, used by messages and statuslines and similar - as part of draw_cmdline() for drawing the cmdline This replaces all these with a post-processing step in grid_put_linebuf(), which has become the entry point for all text rendering after recent refactors. An aim of this is to make the handling of multibyte text yet simpler. One of the main reasons multibyte chars needs to be "parsed" into codepoint arrays of composing chars is so that these could be inspected for the purpose of shaping. This can likely be vastly simplified in many contexts where only the total length (in bytes) and width of composed char is needed.
* | fix(lsp): account for border height in max floating popup height (#25539)LW2023-10-08
| |
* | Merge pull request #25522 from glepnir/4334bfredl2023-10-07
|\ \ | | | | | | fix(ui): trigger TabNewEntered after split new tab
| * | fix(ui): trigger TabNewEntered after split new tabglepnir2023-10-07
| | |
* | | vim-patch:9.0.1995: Invalid memory access with empty 'foldexpr' (#25530)zeertzjq2023-10-07
| |/ |/| | | | | | | | | | | | | Problem: Invalid memory access when 'foldexpr' returns empty string. Solution: Check for NUL. closes: vim/vim#13293 https://github.com/vim/vim/commit/a991ce9c083bb8c02b1b1ec34ed35728197050f3
* | fix(lua): vim.region on linewise selection #25467Aayush Ojha2023-10-06
| | | | | | fixes #18155
* | refactor: cleanupJustin M. Keyes2023-10-06
| |
* | fix: gf fails on "foo/bar.txt:1:2" on WindowsLeonardo Mello2023-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: On Windows, "gf" fails on a filepath that has a line:column suffix. Example: E447: Can't find file "src/app/core/services/identity/identity.service.ts:64:23" Solution: - Remove ":" from 'isfname' on Windows. Colon is not a valid filename character (except for the drive-letter). - Handle drive letters specially in file_name_in_line(). Fixes #25160
* | Merge pull request #25513 from bfredl/cleangridbfredl2023-10-06
|\ \ | | | | | | refactor(grid): get rid of unbatched grid_puts and grid_putchar
| * | refactor(grid): get rid of unbatched grid_puts and grid_putcharbfredl2023-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This finalizes the long running refactor from the old TUI-focused grid implementation where text-drawing cursor was not separated from the visible cursor. Still, the pattern of setting cursor position together with updating a line was convenient. Introduce grid_line_cursor_goto() to still allow this but now being explicit about it. Only having batched drawing functions makes code involving drawing a bit longer. But it is better to be explicit, and this highlights cases where multiple small redraws can be grouped together. This was the case for most of the changed places (messages, lastline, and :intro)