aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
...
* | | vim-patch:9.1.1007: filetype: various ignore are not recognizedChristian Clason2025-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: various ignore are not recognized Solution: detect rg/docker/npm/vvsce ignore files as 'gitgnore' filetype (Wu, Zhenyu) Not only prettier, but many programs also support ignore files (like rg, docker, npm, vscode). So use the gitignore filetype for them due to same syntax closes: vim/vim#16428 https://github.com/vim/vim/commit/8cbe2e0a0a78f57bb545a97695bfedd6a95e6992 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* | | vim-patch:9.1.1003: [security]: heap-buffer-overflow with visual mode (#31971)zeertzjq2025-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: [security]: heap-buffer-overflow with visual mode when using :all, causing Vim trying to access beyond end-of-line (gandalf) Solution: Reset visual mode on :all, validate position in gchar_pos() and charwise_block_prep() This fixes CVE-2025-22134 Github Advisory: https://github.com/vim/vim/security/advisories/GHSA-5rgf-26wj-48v8 https://github.com/vim/vim/commit/c9a1e257f1630a0866447e53a564f7ff96a80ead Co-authored-by: Christian Brabandt <cb@256bit.org>
* | | vim-patch:9.1.1005: completion text is highlighted even with no pattern ↵zeertzjq2025-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | found (#31973) Problem: completion text is highlighted even with no pattern found Solution: use ins_compl_leader_len() instead of checking compl_leader.length (glepnir) closes: vim/vim#16422 https://github.com/vim/vim/commit/9fddb8ae770be3e16545dd4c2f4cfaad8f62cb40 Co-authored-by: glepnir <glephunter@gmail.com>
* | | docs: miscdundargoc2025-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Axel <axelhjq@gmail.com> Co-authored-by: Colin Kennedy <colinvfx@gmail.com> Co-authored-by: Daiki Noda <sys9kdr@users.noreply.github.com> Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com> Co-authored-by: Jean-Jacq du Plessis <1030058+jj-du-plessis@users.noreply.github.com> Co-authored-by: Juan Giordana <juangiordana@gmail.com> Co-authored-by: Lincoln Wallace <locnnil0@gmail.com> Co-authored-by: Matti Hellström <hellstrom@scm.com> Co-authored-by: Steven Locorotondo <steven.locorotondo@justeattakeaway.com> Co-authored-by: Yochem van Rosmalen <git@yochem.nl> Co-authored-by: glepnir <glephunter@gmail.com> Co-authored-by: ifish <fishioon@live.com>
* | | vim-patch:9.1.0996: ComplMatchIns may highlight wrong text (#31931)glepnir2025-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ComplMatchIns may highlight wrong text Solution: don't highlight in case of fuzzy match, skip-highlight when not inserting anything (glepnir) closes: vim/vim#16404 https://github.com/vim/vim/commit/e890887b8052561ac5f8dce218e578ed28599cc6
* | | refactor(api): deprecate nvim_notify #31938Justin M. Keyes2025-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The `nvim_notify` API (note: unrelated to `vim.notify()` Lua API) was not given any real motivation in https://github.com/neovim/neovim/pull/13843 There are, and were, idiomatic and ergonomic alternatives already. Solution: Deprecate `nvim_notify`.
* | | fix(decor): set invalid flag for end of invalidated paired marksLuuk van Baal2025-01-10
| | |
* | | vim-patch:9.1.1000: tests: ruby tests fail with Ruby 3.4 (#31940)zeertzjq2025-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: tests: ruby tests fail with Ruby 3.4 Solution: adjust expected output for Ruby 3.4 (Yee Cheng Chin) Vim's Ruby tests relied on explicit matching of output texts which are fragile in design. Ruby 3.4 has changed the output slightly (using 'name' instead of `name', and also using more spaces in dictionary printouts). Modify the Vim tests to be less fragile to such changes. closes: vim/vim#16411 https://github.com/vim/vim/commit/ebea31e454b9a1731cde845226f2c28ca5c097b1 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* | | vim-patch:9.1.0999: Vim9: leaking finished exception (#31939)zeertzjq2025-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: leaking finished exception (after v9.1.0984) Solution: use finish_exception to clean up caught exceptions (Yee Cheng Chin) In Vimscript, v:exception/throwpoint/stacktrace are supposed to reflect the currently caught exception, and be popped after the exception is finished (via endtry, finally, or a thrown exception inside catch). Vim9script does not handle this properly, and leaks them instead. This is clearly visible when launching GVim with menu enabled. A caught exception inside the s:BMShow() in menu.vim would show up when querying `v:stacktrace` even though the exception was already caught and handled. To fix this, just use the same functionality as Vimscript by calling `finish_exception` to properly restore the states. Note that this assumes `current_exception` is always the same as `caught_stack` which believe should be the case. Added tests for this. Also fix up test_stacktrace to properly test the stack restore behavior where we have nested exceptions in catch blocks and to also test the vim9script functionality properly. - Also, remove its dependency on explicitly checking a line number in runtest.vim which is a very fragile way to write tests as any minor change in runtest.vim (shared among all tests) would require changing test_stacktrace.vim. We don't actually need such granularity in the test. closes: vim/vim#16413 https://github.com/vim/vim/commit/2051af1642843426714efc2572c3e270fe0948be Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* | | docs: misc #31867Justin M. Keyes2025-01-09
| | |
* | | Merge #31900 from luukvbaal/nvim_echoJustin M. Keyes2025-01-09
|\ \ \ | |/ / |/| |
| * | feat(api): add err field to nvim_echo() optsLuuk van Baal2025-01-09
| | | | | | | | | | | | | | | | | | | | | | | | Problem: We want to deprecate `nvim_err_write(ln)()` but there is no obvious replacement (from Lua). Meanwhile we already have `nvim_echo()` with an `opts` argument. Solution: Add `err` argument to `nvim_echo()` that directly maps to `:echoerr`.
* | | Merge pull request #31844 from bfredl/iter_crashbfredl2025-01-09
|\ \ \ | | | | | | | | fix(decoration): fix crash when on_lines decor provider modifies marktree
| * | | fix(decoration): fix crash when on_lines decor provider modifies marktreebfredl2025-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a "on_lines" callback changes the structure of the marktree, the iterator (which is used for an entire window viewport) might now point to invalid memory. Restore the iterator to the beginning of the line in this case. fixes #29484
* | | | fix(terminal): don't crash on unprintable charsbfredl2025-01-09
| | | | | | | | | | | | | | | | fixes #31897
* | | | vim-patch:9.1.0998: filetype: TI assembly files are not recognized (#31929)zeertzjq2025-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: TI assembly files are not recognized Solution: inspect '*.sa' and assembly files and detect TI assembly files, include filetype plugin and syntax script for TI assembly files (Wu, Zhenyu) closes: vim/vim#15827 https://github.com/vim/vim/commit/4f73c07abff420bad9fa5befc2c284c00b984993 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* | | | Revert "refactor(options): set option value for non-current context ↵zeertzjq2025-01-09
| | | | | | | | | | | | | | | | | | | | directly" (#31924) Reverts #31112
* | | | Merge pull request #31112 from famiu/refactor/options/set_option_forLewis Russell2025-01-08
|\ \ \ \ | | | | | | | | | | refactor(options): set option value for non-current context directly
| * | | | refactor(options): set option value for non-current context directlyFamiu Haque2024-12-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Currently, we use `switch_option_context` to temporarily switch the current option context before setting an option for a different buffer / window. This is not ideal because we already support getting and setting option values for non-current contexts in the underlying implementation. Solution: Set option value for non-current context by passing the context directly to the lower level functions. Also introduce a new `OptCtx` struct to store option context information, this will scale much better if we add more option scopes and other context information in the future.
* | | | | test(treesitter): inspect_tree #31182Guilherme Soares2025-01-08
| | | | | | | | | | | | | | | To prevent #30986 and #31198 regression update inspect_tree tests
* | | | | vim-patch:9.1.0995: filetype: shaderslang files are not detectedChristian Clason2025-01-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: shaderslang files are not detected Solution: detect '*.slang' files as shaderslang filetype, include a filetype and syntax script (mtvare6) Reference: https://shader-slang.com/ closes: vim/vim#16387 https://github.com/vim/vim/commit/616219f684744bcfad61a53c13166cda9b141dea Co-authored-by: mtvare6 <mtvare6@proton.me>
* | | | | fix(api): crash on invalid buffer to nvim_buf_del_user_command (#31908)zeertzjq2025-01-08
| | | | |
* | | | | feat(health): show :checkhealth in floating window #31086glepnir2025-01-07
| | | | | | | | | | | | | | | | | | | | Problem: health can not shown in a floating window Solution: add g:health variable
* | | | | perf(treesitter): don't fetch parser for each fold lineRiley Bruins2025-01-07
| |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | **Problem:** The treesitter `foldexpr` calls `get_parser()` for each line in the buffer when calculating folds. This can be incredibly slow for buffers where a parser cannot be found (because the result is not cached), and exponentially more so when the user has many `runtimepath`s. **Solution:** Only fetch the parser when it is needed; that is, only when initializing fold data for a buffer. Co-authored-by: Jongwook Choi <wookayin@gmail.com> Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* | | | refactor: adopt vtermdundargoc2025-01-07
| | | | | | | | | | | | | | | | | | | | | | | | We have changed too much to consider it a mere bundled dependency (such as unicode handling in e3bfcf2fd4a4ebf00b104b082cfe83c8144a842d), and can consider it our own at this point.
* | | | vim-patch:9.1.0991: v:stacktrace has wrong type in Vim9 scriptzeertzjq2025-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: v:stacktrace has wrong type in Vim9 script. Solution: Change the type to t_list_dict_any. Fix grammar in docs. (zeertzjq) closes: vim/vim#16390 https://github.com/vim/vim/commit/6655bef33047b826e0ccb8c686f3f57e47161b1c
* | | | vim-patch:9.1.0984: exception handling can be improvedzeertzjq2025-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: exception handling can be improved Solution: add v:stacktrace and getstacktrace() closes: vim/vim#16360 https://github.com/vim/vim/commit/663d18d6102f40d14e36096ec590445e61026ed6 Co-authored-by: ichizok <gclient.gaap@gmail.com> Co-authored-by: Naruhiko Nishino <naru123456789@gmail.com>
* | | | vim-patch:9.1.0993: New 'cmdheight' behavior may be surprising #31892luukvbaal2025-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Although patch 9.1.0990 fixed a real problem/inconsistency, it also introduced new behavior that may break BWC and/or be unexpected. Before 9.1.0990, window commands could make the topframe smaller (without changing 'cmdheight'; quirk that is now fixed), but did not allow extending the topframe beyond the 'cmdheight' set by the user. After 9.1.0990, the user can reduce the 'cmdheight' below the value they set explicitly, through window commands, which may lead to confusion. (aftere v9.1.0990) Solution: Store the value explicitly set by the user and clamp the 'cmdheight' when resizing the topframe. This also applies to dragging laststatus, which in contrast to window commands _did_ allow reducing the 'cmdheight' to values below the one set by the user. So with this patch there is still new behavior, but I think in a way that is less surprising. While at it, also fix a Coverity warning, introduced in v9.1.0990 (Luuk van Baal) https://github.com/vim/vim/commit/c97e8695353565d6b20adffa48aad47f6e09967f
* | | | Merge #31625 perf(decor): improve iter_captures() cacheJustin M. Keyes2025-01-06
|\ \ \ \
| * | | | refactor: split predicates and directivesvanaigr2025-01-06
| | | | |
| * | | | test: benchmark treesitter highlighingvanaigr2025-01-06
| | | | |
* | | | | fix(lsp): open_floating_preview() zindex relative to current window #31886luukvbaal2025-01-06
|/ / / / | | | | | | | | | | | | | | | | Problem: open_floating_preview() may be hidden behind current window if that is floating and has a higher zindex. Solution: Open floating preview with zindex higher than current window.
* | | | "nvim -es": disable shada #21723Justin M. Keyes2025-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: `nvim -es` (and `nvim -Es`) is the recommended way to non-interactively run commands/vimscript. But it enables shada by default, which is usually not wanted. Solution: - Disable shada by default for `nvim -es/-Es`. This can be overridden by `-i foo` if needed. - Do NOT change the 'loadplugins' default. - User config + packages _should_ be enabled by default, for both `nvim -es` and `nvim -l`. Else any Lua packages you have can't be accessed without `-u path/to/config`, which is clumsy. - Use-cases: ``` nvim --headless "+Lazy! sync" +qa would become: nvim -es "+Lazy! sync" nvim --headless +PlugInstall +qall would become: nvim -es +PlugInstall ``` - Opt-out (`--clean` or `-u NONE`) is much easier than opt-in (`-u path/to/config`). - User config/packages are analogous to pip packages, which are expected when doing `python -c ...`. related: 7c94bcd2d77e2e54b8836ab8325460a367b79eae related: ddd0eb6f5120a09b97867d2561ea61309038ccd2
* | | | fix(cmdline): always show cmdline when it is a prompt #31866luukvbaal2025-01-05
| | | | | | | | | | | | Cmdline prompts should ignore `cmd_silent`.
* | | | fix(api): nvim__complete_set requires completeopt=popup #31177glepnir2025-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: If completeopt does not include "popup" flag, nvim__complete_set still auto-creates a floating preview window. Solution: Fail if completeopt does not include the "popup" flag.
* | | | fix(popup): wrong extmark data sync when lines changed in popup preview #30246glepnir2025-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: when popup preview buffer has filetype like markdown and ts is enabled, the extmark clean and update not correct, if add the extmark sync there has lots of duplicate codes like nvim_buf_set_lines. Solution: use nvim_buf_set_lines api internally to set info to popup preview buffer.
* | | | feat(func): allow manual cache invalidation for _memoizeRiley Bruins2025-01-05
| | | | | | | | | | | | | | | | | | | | This commit also adds some tests for the existing memoization functionality.
* | | | vim-patch:9.1.0990: Inconsistent behavior when changing cmdheight (#31830)luukvbaal2025-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Inconsistent behavior when changing cmdheight by resizing the topframe through wincmds and dragging laststatus. Changing cmdheight by resizing the topframe does not trigger OptionSet. Solution: Consolidate logic for changing the cmdheight, set the option value to handle side-effects (Luuk van Baal) https://github.com/vim/vim/commit/e15cbc1af47e9dea90448c714eb4908e5d4302fc vim-patch:9.0.0187: command line height changes when maximizing window height Problem: Command line height changes when maximizing window height. Solution: Do not change the command line height. (closes vim/vim#10885) https://github.com/vim/vim/commit/96bde99bf890acd9952863a02c1d15edca2000e1
* | | | refactor(tests): merge n.spawn/n.spawn_argv into n.new_session #31859Justin M. Keyes2025-01-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: - `n.spawn()` is misleading because it also connects RPC, it's not just "spawning" a process. - It's confusing that `n.spawn()` and `n.spawn_argv()` are separate. Solution: - Replace `n.spawn()`/`n.spawn_argv()` with a single function `n.new_session()`. This name aligns with the existing functions `n.set_session`/`n.get_session`. - Note: removes direct handling of `prepend_argv`, but I doubt that was important or intentional. If callers want to control use of `prepend_argv` then we should add a new flag to `test.session.Opts`. - Move `keep` to first parameter of `n.new_session()`. - Add a `merge` flag to `test.session.Opts` - Mark `_new_argv()` as private. Test should use clear/new_session/spawn_wait instead.
* | | | fix(vim.fs.normalize): normalize case for windows drive letterdundargoc2025-01-04
| | | | | | | | | | | | | | | | | | | | Also add tests for the current path casing behavior so it doesn't get accidentally changed.
* | | | test: use spawn_wait() instead of system() #31852Justin M. Keyes2025-01-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Tests that need to check `nvim` CLI behavior (no RPC session) create their own ad-hoc `system()` wrappers. Solution: - Use `n.spawn_wait` instead of `system()`. - Bonus: this also improves the tests by explicitly checking for `stdout` or `stderr`. And if a signal is raised, `ProcStream.status` will reflect it.
* | | | test: include stderr in EOF failure messageJustin M. Keyes2025-01-03
| | | |
* | | | test: spawn_wait() starts a non-RPC Nvim processJustin M. Keyes2025-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Can't use `n.clear()` to test non-RPC `nvim` invocations. So tests end up creating ad-hoc wrappers around `system()` or `jobstart()`. Solution: - Introduce `n.spawn_wait()` - TODO (followup PR): Rename `n.spawn()` and `n.spawn_wait()`. It's misleading that `n.spawn()` returns a RPC session...
* | | | fix(messages): better formatting for ext_messages #31839luukvbaal2025-01-03
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Message grid newline formatting based on `msg_col` is not utilized with ext_messages. Solution: Increment `msg_col` with the cell width of the chunk. Allowing message code that uses `msg_col` to determine when to place a newline to do so. E.g. when the message goes beyond `Columns`; this is not necessarily where the ext_messages implementation would want to place a newline, but it is a best guess. Message parsing and manipulation is still possible.
* | | vim-patch:9.1.0987: filetype: cake files are not recognizedChristian Clason2025-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: cake files are not recognized Solution: detect '*.cake' files as cs filetype (Zoe Roux) References: https://cakebuild.net/ closes: vim/vim#16367 https://github.com/vim/vim/commit/a407573f30a978b3aa61532bbd9b0ae94a87dc32 Co-authored-by: Zoe Roux <zoe.roux@zoriya.dev>
* | | vim-patch:9.1.0986: filetype: 'jj' filetype is a bit impreciseChristian Clason2025-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: 'jj' filetype is a bit imprecise Solution: rename 'jj' filetype to 'jjdescription' (Gregory Anders) closes: vim/vim#16364 https://github.com/vim/vim/commit/58c44e8833365e1a777330491c2799ae324ed893 Co-authored-by: Gregory Anders <greg@gpanders.com>
* | | Merge pull request #31635 from bfredl/vtermpiratesbfredl2025-01-03
|\ \ \ | | | | | | | | feat(terminal): support grapheme clusters, including emoji
| * | | feat(terminal): support grapheme clusters, including emojibfredl2025-01-02
| | | |
* | | | feat(ui): more intuitive :substitute confirm prompt #31787luukvbaal2025-01-02
| | | | | | | | | | | | | | | | Problem: Unknown key mappings listed in substitute confirm message. Solution: Include hints as to what the key mappings do.
* | | | feat(ui)!: emit prompt "messages" as cmdline events #31525luukvbaal2025-01-02
|/ / / | | | | | | | | | | | | | | | | | | Problem: Prompts are emitted as messages events, where cmdline events are more appropriate. The user input is also emitted as message events in fast context, so cannot be displayed with vim.ui_attach(). Solution: Prompt for user input through cmdline prompts.