aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
...
* feat(mbyte): support extended grapheme clusters including more emojibfredl2024-08-30
| | | | | | | | | Use the grapheme break algorithm from utf8proc to support grapheme clusters from recent unicode versions. Handle variant selector VS16 turning some codepoints into double-width emoji. This means we need to use ptr2cells rather than char2cells when possible.
* fix(tohtml): apply sp color if present #30110Riley Bruins2024-08-29
| | | | | | | | | | | | | | | Problem: Things like underlines are always given a default foreground highlight regardless of the value of `sp`. Solution: Check for `sp` first, and apply that color to the text decoration color if it exists. Limitations: If there is no value of `sp`, vim applies a text decoration color that matches the foreground of the text. This is still not implemented (and seems like a much more complex problem): in TOhtml, the underline will still be given a default foreground highlight.
* vim-patch:9.1.0699: "dvgo" is not always an inclusive motion (#30173)zeertzjq2024-08-29
| | | | | | | | | | | | Problem: "dvgo" is not always an inclusive motion (Iain King-Speir) Solution: initialize the inclusive flag to false fixes: vim/vim#15580 closes: vim/vim#15582 https://github.com/vim/vim/commit/f8702aeb8ff85554d909901ae45b50c3d532bf70 Co-authored-by: Christian Brabandt <cb@256bit.org>
* feat(treesitter): add support for wasm parsersLewis Russell2024-08-26
| | | | | | | | | | | | | | | | | | | | Problem: Installing treesitter parser is hard (harder than climbing to heaven). Solution: Add optional support for wasm parsers with `wasmtime`. Notes: * Needs to be enabled by setting `ENABLE_WASMTIME` for tree-sitter and Neovim. Build with `make CMAKE_EXTRA_FLAGS=-DENABLE_WASMTIME=ON DEPS_CMAKE_FLAGS=-DENABLE_WASMTIME=ON` * Adds optional Rust (obviously) and C11 dependencies. * Wasmtime comes with a lot of features that can negatively affect Neovim performance due to library and symbol table size. Make sure to build with minimal features and full LTO. * To reduce re-compilation times, install `sccache` and build with `RUSTC_WRAPPER=<path/to/sccache> make ...`
* vim-patch:9.1.0694: matchparen is slow on a long line (#30134)zeertzjq2024-08-25
| | | | | | | | | | | | | | | | | Problem: The matchparen plugin is slow on a long line. Solution: Don't use a regexp to get char at and before cursor. (zeertzjq) Example: ```vim call setline(1, repeat(' foobar', 100000)) runtime plugin/matchparen.vim normal! $hhhhhhhh ``` closes: vim/vim#15568 https://github.com/vim/vim/commit/81e7513c86459c40676bd983f73c2722096d67a9
* vim-patch:9.1.0692: Wrong patlen value in ex_substitute() (#30131)zeertzjq2024-08-24
| | | | | | | | | | | | Problem: Wrong patlen value in ex_substitute() (after 9.1.0426). Solution: Compute patlen after finding end separator. (zeertzjq) Add a more explicit test. The test already passes as the only case where a overlarge patlen value matters was fixed by patch 9.1.0689. closes: vim/vim#15565 https://github.com/vim/vim/commit/d1c8d2de4b9fa44b3d2b39b7ed8b92846c5502b7
* vim-patch:9.1.0690: cannot set special highlight kind in popupmenu (#30128)zeertzjq2024-08-24
| | | | | | | | | | | Problem: cannot set special highlight kind in popupmenu Solution: add kind_hlgroup item to complete function (glepnir) closes: vim/vim#15561 https://github.com/vim/vim/commit/38f99a1f0d61e9bde3f4a3d0cbe2d06185c4a57f Co-authored-by: glepnir <glephunter@gmail.com>
* feat(lsp): completion opts support custom item conversion (#30060)glepnir2024-08-22
| | | | | | | Problem: Some items of completion results include function signatures that can cause the pum to be very long when a function has many params, because pum scales with the longest word/abbr. Solution: add custom covert function that can customise abbr to remove params.
* vim-patch:9.1.0683: mode() returns wrong value with <Cmd> mapping (#30109)zeertzjq2024-08-22
| | | | | | | | | | | Problem: mode() returns wrong value with <Cmd> mapping Solution: Change decision priority of VIsual_active and move visual mode a bit further down (kuuote) closes: vim/vim#15533 https://github.com/vim/vim/commit/0fd1cb1b1fc90b68cb37f71e65289eadac3588a6 Co-authored-by: kuuote <znmxodq1@gmail.com>
* vim-patch:9.1.0686: zip-plugin has problems with special characters (#30108)zeertzjq2024-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: zip-plugin has problems with special characters (user202729) Solution: escape '*?[\' on Unix and handle those chars a bit differently on MS-Windows, add a test, check before overwriting files runtime(zip): small fixes for zip plugin This does the following: - verify the unzip plugin is executable when loading the autoload plugin - handle extracting file names with '[*?\' in its name correctly by escaping those characters for the unzip command (and handle those characters a bit differently on MS-Windows, since the quoting is different) - verify, that the extract plugin is not overwriting a file (could cause a hang, because unzip asking for confirmation) - add a test zip file which contains those special file names fixes: vim/vim#15505 closes: vim/vim#15519 https://github.com/vim/vim/commit/7790ea0c680a9f951a86066e5940ec16b2333c9a Co-authored-by: Christian Brabandt <cb@256bit.org>
* fix(decor): don't use separate DecorSignHighlight for url (#30096)zeertzjq2024-08-20
|
* fix(terminal): interrupt/got_int hangs terminal (#30056)ibhagwan2024-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | | Upon `terminal_enter`, `mapped_ctrl_c` is set in order to avoid `CTRL-C` interrupts (which is proxied to the terminal process instead), `os_inchar` will then test `mapped_ctrl_c` against `State` and set `ctrl_c_interrupts=false` which prevents `process_ctrl_c` from setting `got_int=true` in a terminal state. However, if `got_int` is set outside of `process_ctrl_c`, e.g. via `interrupt()`, this will hang the neovim process as `terminal_execute` will enter an endless loop as `got_int` will never be cleared causing `safe_vgetc` to always return `Ctrl_C`. A minimal example reproducing this bug: ```vim :autocmd TermEnter * call timer_start(500, {-> interrupt()}) :terminal :startinsert ``` To fix, we make sure `got_int` is cleared inside `terminal_execute` when it detects `Ctrl_C`. Closes #20726 Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(terminal): handle C0 characters in OSC terminator (#30090)Gregory Anders2024-08-19
| | | | | | | | | | | | | | When a C0 character is present in an OSC terminator (i.e. after the ESC but before a \ (0x5c) or printable character), vterm executes the control character and resets the current string fragment. If the C0 character is the final byte in the sequence, the string fragment has a zero length. However, because the VT parser is still in the "escape" state, vterm attempts to subtract 1 from the string length (to account for the escape character). When the string fragment is empty, this causes an underflow in the unsigned size variable, resulting in a buffer overflow. The fix is simple: explicitly check if the string length is non-zero before subtracting.
* fix(vim.text): handle very long strings (#30075)Gregory Anders2024-08-17
| | | | | | | | Lua's string.byte has a maximum (undocumented) allowable length, so vim.text.hencode fails on large strings with the error "string slice too long". Instead of converting the string to an array of bytes up front, convert each character to a byte one at a time.
* fix(api): error properly with invalid field in nvim_open_win (#30078)zeertzjq2024-08-17
|
* vim-patch:9.1.0677: :keepp does not retain the substitute patternzeertzjq2024-08-17
| | | | | | | | | | | | | Problem: :keeppatterns does not retain the substitute pattern for a :s command Solution: preserve the last substitute pattern when used with the :keeppatterns command modifier (Gregory Anders) closes: vim/vim#15497 https://github.com/vim/vim/commit/3b59be4ed8a145d3188934f1a5cd85432bd2433d Co-authored-by: Gregory Anders <greg@gpanders.com>
* vim-patch:9.1.0678: [security]: use-after-free in alist_add()zeertzjq2024-08-17
| | | | | | | | | | | | | Problem: [security]: use-after-free in alist_add() (SuyueGuo) Solution: Lock the current window, so that the reference to the argument list remains valid. This fixes CVE-2024-43374 https://github.com/vim/vim/commit/0a6e57b09bc8c76691b367a5babfb79b31b770e8 Co-authored-by: Christian Brabandt <cb@256bit.org>
* fix(man): avoid setting v:errmsg (#30052)zeertzjq2024-08-15
|
* feat(term): support OSC 8 hyperlinks in :terminal (#30050)Gregory Anders2024-08-15
|
* refactor(tests): again yet more global highlight definitionsbfredl2024-08-14
|
* test: remove internal assertions and simplifyfutsuuu2024-08-13
|
* test: add a test to check the indentationfutsuuu2024-08-13
|
* vim-patch:9.1.0672: marker folds may get corrupted on undo (#30026)zeertzjq2024-08-11
| | | | | | | | | | | | | Problem: marker folds may get corrupted on undo (Yousef Mohammed) Solution: when adjusting folds, make sure that line1 is the lower limit and line2 is the upper line limit. In particular, line2 should not be able to get smaller than line1. fixes: vim/vim#15455 closes: vim/vim#15466 https://github.com/vim/vim/commit/8d02e5cf961b06da5bc490ac5972bcbc252c4793 Co-authored-by: Christian Brabandt <cb@256bit.org>
* test(lsp): refactor and tidyLewis Russell2024-08-11
| | | | | | | - Merge all the top level 'LSP' describe blocks - Refactor text edit tests - Fix typing errors - Add linebreaks between tests
* feat(term): enable reflow by default (#21124)Christian Clason2024-08-10
| | | | | | | | | | | | Problem: Contents of terminal buffer are not reflown when Nvim is resized. Solution: Enable reflow in libvterm by default. Now that libvterm is vendored, also fix "TUI rapid resize" test failures there. Note: Neovim's scrollback buffer does not support reflow (yet), so lines vanishing into the buffer due to a too small window will be restored without reflow.
* vim-patch:9.1.0667: Some other options reset curswant unnecessarily when set ↵zeertzjq2024-08-10
| | | | | | | | | | | | | (#30020) Problem: Some other options reset curswant unnecessarily when set. (Andrew Haust) Solution: Don't reset curswant when setting 'comments', 'commentstring' or 'define' (zeertzjq) fixes: vim/vim#15462 closes: vim/vim#15467 https://github.com/vim/vim/commit/b026a293b1e9d7a30f7717e256fe5f7f1dfa20d7
* vim-patch:9.1.0666: assert_equal() doesn't show multibyte string correctly ↵zeertzjq2024-08-10
| | | | | | | | | | | (#30018) Problem: assert_equal() doesn't show multibyte string correctly Solution: Properly advance over a multibyte char. (zeertzjq) closes: vim/vim#15456 https://github.com/vim/vim/commit/9c4b2462bb498f44044616f7309d111d12170369
* vim-patch:8.2.4860: MS-Windows: always uses current directory for executableszeertzjq2024-08-09
| | | | | | | | | | | | Problem: MS-Windows: always uses current directory for executables. Solution: Check the NoDefaultCurrentDirectoryInExePath environment variable. (Yasuhiro Matsumoto, closes vim/vim#10341) https://github.com/vim/vim/commit/05cf63e9bdca1ac070df3e7d9c6dfc45e68ac916 Omit doc change: override in later doc update. Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
* vim-patch:8.2.3477: startup test fails on MS-Windowszeertzjq2024-08-08
| | | | | | | | | Problem: Startup test fails on MS-Windows. Solution: Skip the test if not on Unix. https://github.com/vim/vim/commit/6d197987745427801a2195836ef89e48537afbeb Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.3476: renaming a buffer on startup may cause using freed memoryzeertzjq2024-08-08
| | | | | | | | | | | Problem: Renaming a buffer on startup may cause using freed memory. Solution: Check if the buffer is used in a window. (closes vim/vim#8955) https://github.com/vim/vim/commit/d3710cf01ef6ab1b2f233866ff01dab76686f642 Cherry-pick Test_echo_true_in_cmd() from Vim. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.1.0663: tests: zip test still resets 'shellslash' optionzeertzjq2024-08-07
| | | | | | | | | | | | Problem: tests: zip test still resets 'shellslash' option Solution: Remove resetting the 'shellslash' option, the zip plugin should now be able to handle this options closes: vim/vim#15434 https://github.com/vim/vim/commit/91efcd115e700725b9ebded0f5d7bc0d3fa98d9d Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.1.0661: the zip plugin is not tested. (#29993)zeertzjq2024-08-06
| | | | | | | | | | Problem: the zip plugin is not tested. Solution: include tests (Damien) closes: vim/vim#15411 https://github.com/vim/vim/commit/d7af21e746f3992c650caf6b76465880b96302b4 Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
* fix(filetype): fix :filetype detect error with -u NONE (#29991)zeertzjq2024-08-06
| | | | :filetype detect should enable filetype detection when it hasn't been enabled before.
* vim-patch:8.2.4838: checking for absolute path is not trivial (#29990)zeertzjq2024-08-06
| | | | | | | | | | Problem: Checking for absolute path is not trivial. Solution: Add isabsolutepath(). (closes vim/vim#10303) https://github.com/vim/vim/commit/dca1d40cd0f2af0755519e7028378bd3c8fefd31 vim-patch:8a3b805c6c9c Co-authored-by: LemonBoy <thatlemon@gmail.com>
* vim-patch:9.1.0465: missing filecopy() function (#29989)zeertzjq2024-08-06
| | | | | | | | | | | Problem: missing filecopy() function Solution: implement filecopy() Vim script function (Shougo Matsushita) closes: vim/vim#12346 https://github.com/vim/vim/commit/60c8743ab6c90e402e6ed49d27455ef7e5698abe Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
* refactor(shada): rework msgpack decoding without msgpack-cbfredl2024-08-05
| | | | | | | This also makes shada reading slightly faster due to avoiding some copying and allocation. Use keysets to drive decoding of msgpack maps for shada entries.
* vim-patch:9.1.0648: [security] double-free in dialog_changed()zeertzjq2024-08-03
| | | | | | | | | | | | | | | | | Problem: [security] double-free in dialog_changed() (SuyueGuo) Solution: Only clear pointer b_sfname pointer, if it is different than the b_ffname pointer. Don't try to free b_fname, set it to NULL instead. fixes: vim/vim#15403 Github Advisory: https://github.com/vim/vim/security/advisories/GHSA-46pw-v7qw-xc2f https://github.com/vim/vim/commit/b29f4abcd4b3382fa746edd1d0562b7b48c9de60 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.1.0655: filetype: goaccess config file not recognizedChristian Clason2024-08-03
| | | | | | | | | | | | | | | | | | | Problem: filetype: goaccess config file not recognized Solution: detect 'goaccess.conf' as goaccess filetype, also include a basic syntax and ftplugin (Adam Monsen) Add syntax highlighting for GoAccess configuration file. GoAccess is a real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser. GoAccess home page: https://goaccess.io closes: vim/vim#15414 https://github.com/vim/vim/commit/0aa65b48fbe64e18a767b207802483026baecb5d Co-authored-by: Adam Monsen <haircut@gmail.com>
* test: allow exec_lua to handle functionsLewis Russell2024-08-02
| | | | | | | | | | | Problem: Tests have lots of exec_lua calls which input blocks of code provided as unformatted strings. Solution: Teach exec_lua how to handle functions.
* refactor(lsp): add test case for default diagnostic severityMathias Fussenegger2024-08-02
| | | | | | | | See https://github.com/microsoft/language-server-protocol/pull/1978 If the severity is not specified by the server, error should be used. This was already the case because it matches the vim.diagnostic default. This only adds a test case for it.
* fix(eval): handle wrong v:lua in expr option properly (#29953)zeertzjq2024-08-02
|
* vim-patch:9.0.0632: calling a function from an "expr" option has overheadzeertzjq2024-08-02
| | | | | | | | | | | | Problem: Calling a function from an "expr" option has too much overhead. Solution: Add call_simple_func() and use it for 'foldexpr' https://github.com/vim/vim/commit/87b4e5c5db9d1cfd6f2e79656e1a6cff3c69d15f Cherry-pick a call_func() change from patch 8.2.1343. Add expr-option-function docs to options.txt. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4416: Vim9: using a script-local function requires using "s:" ↵zeertzjq2024-08-02
| | | | | | | | | | | | | | | | | | (#29950) Problem: Vim9: using a script-local function requires using "s:" when setting 'completefunc'. Solution: Do not require "s:" in Vim9 script. (closes vim/vim#9796) https://github.com/vim/vim/commit/1fca5f3e86f08e696058fc7e86dfe41b415a78e6 vim-patch:8.2.4417: using NULL pointer Problem: Using NULL pointer. Solution: Set offset after checking for NULL pointer. https://github.com/vim/vim/commit/e89bfd212b21c227f026e467f882c62cdd6e642d Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.1.0651: ex: trailing dot is optional for :g and :insert/:append ↵zeertzjq2024-08-02
| | | | | | | | | | | | | | | | (#29946) Problem: ex: trailing dot is optional for :g and :insert/:append Solution: don't break out early, when the next command is empty. (Mohamed Akram) The terminating period is optional for the last command in a global command list. closes: vim/vim#15407 https://github.com/vim/vim/commit/0214680a8ec5f7f656cb42e5db19243709202ed2 Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
* vim-patch:9.1.0647: [security] use-after-free in tagstack_clear_entryzeertzjq2024-08-02
| | | | | | | | | | | | | | | | | | | Problem: [security] use-after-free in tagstack_clear_entry (Suyue Guo ) Solution: Instead of manually calling vim_free() on each of the tagstack entries, let's use tagstack_clear_entry(), which will also free the stack, but using the VIM_CLEAR macro, which prevents a use-after-free by setting those pointers to NULL This addresses CVE-2024-41957 Github advisory: https://github.com/vim/vim/security/advisories/GHSA-f9cr-gv85-hcr4 https://github.com/vim/vim/commit/8a0bbe7b8aad6f8da28dee218c01bc8a0185a2d5 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.0.2158: [security]: use-after-free in check_argument_typezeertzjq2024-08-02
| | | | | | | | | | | | | | | | | | | | | | Problem: [security]: use-after-free in check_argument_type Solution: Reset function type pointer when freeing the function type list function pointer fp->uf_func_type may point to the same memory, that was allocated for fp->uf_type_list. However, when cleaning up a function definition (e.g. because it was invalid), fp->uf_type_list will be freed, but fp->uf_func_type may still point to the same (now) invalid memory address. So when freeing the fp->uf_type_list, check if fp->func_type points to any of those types and if it does, reset the fp->uf_func_type pointer to the t_func_any (default) type pointer closes: vim/vim#13652 https://github.com/vim/vim/commit/0f28791b215bd4c22ed580839409c2f7d39d8140 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.0.2149: [security]: use-after-free in exec_instructions()zeertzjq2024-08-02
| | | | | | | | | | | | | | | | | | | Problem: [security]: use-after-free in exec_instructions() Solution: get tv pointer again [security]: use-after-free in exec_instructions() exec_instructions may access freed memory, if the GA_GROWS_FAILS() re-allocates memory. When this happens, the typval tv may still point to now already freed memory. So let's get that pointer again and compare it with tv. If those two pointers differ, tv is now invalid and we have to refresh the tv pointer. closes: vim/vim#13621 https://github.com/vim/vim/commit/5dd41d4b6370b7b7d09d691f9252b3899c66102a Co-authored-by: Christian Brabandt <cb@256bit.org>
* fix(lsp): don't send foreign diagnostics to servers in buf.code_action (#29501)Mathias Fußenegger2024-08-01
| | | | | | | `buf.code_action` always included diagnostics on a given line from all clients. Servers should only receive diagnostics they published, and in the exact same format they sent it. Should fix https://github.com/neovim/neovim/issues/29500
* vim-patch:8.2.4275: cannot use an autoload function from a package under ↵zeertzjq2024-08-01
| | | | | | | | | | | | | | | | | start (#29937) Problem: Cannot use an autoload function from a package under start. Solution: Also look in the "start" package directory. (Bjorn Linse, closes vim/vim#7193) https://github.com/vim/vim/commit/223a950a85448253780da4e821a5b23dcdfad28f Nvim already does this in do_in_cached_path(), and this change has no effect in Nvim as Nvim removes DIP_START after do_in_cached_path(). Accidentally failed to mark as ported: vim-patch:8.2.1731: Vim9: cannot use += to append to empty NULL list Co-authored-by: bfredl <bjorn.linse@gmail.com>
* fix(lsp): prevent desync due to empty buffer (#29904)Jaehwang Jung2024-07-31
| | | | | | | | | | | | | | | Problem: Some language servers (e.g., rust-analyzer, texlab) are desynced when the user deletes the entire contents of the buffer. This is due to the discrepancy between how nvim computes diff and how nvim treats empty buffer. * diff: If the buffer became empty, then the diff includes the last line's eol. * empty buffer: Even if the buffer is empty, nvim regards it as having a single empty line with eol. Solution: Add special case for diff computation when the buffer becomes empty so that it does not include the eol of the last line.