aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
...
* 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.
* feat(lsp): lsp.completion support set deprecated (#29882)glepnir2024-07-31
| | | | | | Problem: CompletionItem in lsp spec mentioned the deprecated attribute Solution: when item has deprecated attribute set hl_group to DiagnosticDeprecated in complete function
* fix(scrollbind): properly take filler/virtual lines into accountLewis Russell2024-07-31
| | | | | | | | | | | | | | | | | | Problem: `'scrollbind'` does not work properly if the window being scrolled automatically contains any filler/virtual lines (except for diff filler lines). This is because when the scrollbind check is done, the logic only considers changes to topline which are represented as line numbers. Solution: Write the logic for determine the scroll amount to take into account filler/virtual lines. Fixes #29751
* vim-patch:9.1.0419: eval.c not sufficiently testedzeertzjq2024-07-31
| | | | | | | | | | | | Problem: eval.c not sufficiently tested Solution: Add a few more additional tests for eval.c, (Yegappan Lakshmanan) closes: vim/vim#14799 https://github.com/vim/vim/commit/4776e64e72de2976ff90b17d236e50e2b02c5540 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.1.0415: Some functions are not testedzeertzjq2024-07-31
| | | | | | | | | | | | Problem: Some functions are not tested Solution: Add a few more tests, fix a few minor problems (Yegappan Lakshmanan) closes: vim/vim#14789 https://github.com/vim/vim/commit/fe424d13ef6e5486923f23f15bb6951e3079412e Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.1.0645: regex: wrong match when searching multi-byte char ↵zeertzjq2024-07-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | case-insensitive Problem: regex: wrong match when searching multi-byte char case-insensitive (diffsetter) Solution: Apply proper case-folding for characters and search-string This patch does the following 4 things: 1) When the regexp engine compares two utf-8 codepoints case insensitive it may match an adjacent character, because it assumes it can step over as many bytes as the pattern contains. This however is not necessarily true because of case-folding, a multi-byte UTF-8 character can be considered equal to some single-byte value. Let's consider the pattern 'ſ' and the string 's'. When comparing and ignoring case, the single character 's' matches, and since it matches Vim will try to step over the match (by the amount of bytes of the pattern), assuming that since it matches, the length of both strings is the same. However in that case, it should only step over the single byte value 's' by 1 byte and try to start matching after it again. So for the backtracking engine we need to ensure: * we try to match the correct length for the pattern and the text * in case of a match, we step over it correctly There is one tricky thing for the backtracing engine. We also need to calculate correctly the number of bytes to compare the 2 different utf-8 strings s1 and s2. So we will count the number of characters in s1 that the byte len specified. Then we count the number of bytes to step over the same number of characters in string s2 and then we can correctly compare the 2 utf-8 strings. 2) A similar thing can happen for the NFA engine, when skipping to the next character to test for a match. We are skipping over the regstart pointer, however we do not consider the case that because of case-folding we may need to adjust the number of bytes to skip over. So this needs to be adjusted in find_match_text() as well. 3) A related issue turned out, when prog->match_text is actually empty. In that case we should try to find the next match and skip this condition. 4) When comparing characters using collections, we must also apply case folding to each character in the collection and not just to the current character from the search string. This doesn't apply to the NFA engine, because internally it converts collections to branches [abc] -> a\|b\|c fixes: vim/vim#14294 closes: vim/vim#14756 https://github.com/vim/vim/commit/22e8e12d9f5034e1984db0c567b281fda4de8dd7 N/A patches: vim-patch:9.0.1771: regex: combining chars in collections not handled vim-patch:9.0.1777: patch 9.0.1771 causes problems Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.0.0105: illegal memory access when pattern starts with illegal bytezeertzjq2024-07-31
| | | | | | | | | Problem: Illegal memory access when pattern starts with illegal byte. Solution: Do not match a character with an illegal byte. https://github.com/vim/vim/commit/f50940531dd57135fe60aa393ac9d3281f352d88 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.1.0644: Unnecessary STRLEN() when applying mapping (#29921)zeertzjq2024-07-31
| | | | | | | | | | Problem: Unnecessary STRLEN() when applying mapping. (after v9.1.0642) Solution: Use m_keylen and vim_strnsave(). (zeertzjq) closes: vim/vim#15394 https://github.com/vim/vim/commit/74011dc1fa7bca6c901937173a42e0edce68e080
* vim-patch:9.0.0333: method test failszeertzjq2024-07-30
| | | | | | | | | Problem: Method test fails. Solution: Adjust test for items() now working on string. https://github.com/vim/vim/commit/171a1607f4b0b3cdcbbe5e886da37a5d11f15684 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.0331: cannot use items() on a stringzeertzjq2024-07-30
| | | | | | | | | Problem: Cannot use items() on a string. Solution: Make items() work on a string. (closes vim/vim#11016) https://github.com/vim/vim/commit/3e518a8ec74065aedd67d352c93d6ae6be550316 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.0330: method tests failzeertzjq2024-07-30
| | | | | | | | | Problem: Method tests fail. Solution: Adjust for change of items(). https://github.com/vim/vim/commit/f92cfb1acc3fef74eef0c83c1a35a2b6a9f93a9b Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:partial:9.0.0327: items() does not work on a listzeertzjq2024-07-30
| | | | | | | | | | | Problem: items() does not work on a list. (Sergey Vlasov) Solution: Make items() work on a list. (closes vim/vim#11013) https://github.com/vim/vim/commit/976f859763b215050a03248dbc2bb62fa5d0d059 Skip CHECK_LIST_MATERIALIZE. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.1.0642: Check that mapping rhs starts with lhs fails if not ↵zeertzjq2024-07-30
| | | | | | | | | | | | | | | simplified (#29909) Problem: Check that mapping rhs starts with lhs doesn't work if lhs is not simplified. Solution: Keep track of the mapblock containing the alternative lhs and also compare with it (zeertzjq). fixes: vim/vim#15376 closes: vim/vim#15384 https://github.com/vim/vim/commit/9d997addc7bd0fd132a809cf497ed816e61fcd25 Cherry-pick removal of save_m_str from patch 8.2.4059.
* vim-patch:9.1.0638: E1510 may happen when formatting a message for smsg() ↵zeertzjq2024-07-29
| | | | | | | | | | | (#29907) Problem: E1510 may happen when formatting a message (after 9.1.0181). Solution: Only give E1510 when using typval. (zeertzjq) closes: vim/vim#15391 https://github.com/vim/vim/commit/0dff31576a340b74cec81517912923c38cb28450
* feat(treesitter): allow get_node to return anonymous nodesRiley Bruins2024-07-29
| | | | | Adds a new field `include_anonymous` to the `get_node` options to allow anonymous nodes to be returned.
* feat(treesitter): add node_for_range functionRiley Bruins2024-07-29
| | | | | | This is identical to `named_node_for_range` except that it includes anonymous nodes. This maintains consistency in the API because we already have `descendant_for_range` and `named_descendant_for_range`.
* vim-patch:9.1.0636: filetype: ziggy files are not recognizedChristian Clason2024-07-29
| | | | | | | | | | | | | | | | Problem: filetype: ziggy files are not recognized Solution: detect '*.ziggy' files as ziggy filetype, detect '*.ziggy-schema' files as ziggy-schema filetype (EliSauder) References: https://ziggy-lang.io/ fixes: vim/vim#15355 closes: vim/vim#15367 https://github.com/vim/vim/commit/f4572cee35a6c224985e71116e676ab711c09af3 Co-authored-by: EliSauder <24995216+EliSauder@users.noreply.github.com>
* vim-patch:9.1.0635: filetype: SuperHTML template files not recognizedChristian Clason2024-07-29
| | | | | | | | | | | | | | Problem: filetype: SuperHTML template files not recognized Solution: Update the filetype detection code to detect '*.shtml' either as HTML (Server Side Includes) or SuperHTML (template files) (EliSauder) related: vim/vim#15355 related: vim/vim#15367 https://github.com/vim/vim/commit/e57c9a19edc906a96ccb8821ae33fa6a8b20c3cd Co-authored-by: EliSauder <24995216+EliSauder@users.noreply.github.com>
* fix(lsp): revert text edit application order change (#29877)Mathias Fußenegger2024-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reverts https://github.com/neovim/neovim/pull/29212 and adds a few additional test cases From the spec > All text edits ranges refer to positions in the document they are > computed on. They therefore move a document from state S1 to S2 without > describing any intermediate state. Text edits ranges must never overlap, > that means no part of the original document must be manipulated by more > than one edit. However, it is possible that multiple edits have the same > start position: multiple inserts, or any number of inserts followed by a > single remove or replace edit. If multiple inserts have the same > position, the order in the array defines the order in which the inserted > strings appear in the resulting text. The previous fix seems wrong. The important part: > If multiple inserts have the same position, the order in the array > defines the order in which the inserted strings appear in the > resulting text. Emphasis on _appear in the resulting text_ Which means that in: local edits1 = { make_edit(0, 3, 0, 3, { 'World' }), make_edit(0, 3, 0, 3, { 'Hello' }), } `World` must appear before `Hello` in the final text. That means the old logic was correct, and the fix was wrong.
* Merge pull request #29876 from glepnir/vim-patchzeertzjq2024-07-27
|\ | | | | vim-patch:9.1.{0618,0619,0629}: cannot mark deprecated attributes in completion menu
| * vim-patch:9.1.0629: Rename of pum hl_group is incompletezeertzjq2024-07-27
| | | | | | | | | | | | | | | | | | | | | | Problem: Rename of pum hl_group is incomplete in source. Solution: Also rename the test function. Rename to user_hlattr in code to avoid confusion with pum_extra. Add test with matched text highlighting (zeertzjq). closes: vim/vim#15348 https://github.com/vim/vim/commit/4100852e099133a0c9603e1087e5dc6d82001ce7
| * test(ui/popupmenu_spec): add case of hl_group field in complete itemsglepnir2024-07-27
| | | | | | | | | | Problem: Missing test case for hl_group field in complete items. Solution: Add a test case for hl_group field.
| * test(ui/popupmenu_spec): make highlights more consistentzeertzjq2024-07-27
| |
| * vim-patch:9.1.0619: tests: test_popup failsglepnir2024-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: tests: test_popup fails (after v9.1.0618) Solution: Correct test, move combining extra attributes to pum_compute_text_attrs() (glepnir) closes: vim/vim#15353 https://github.com/vim/vim/commit/8754efe437fcb17ad2c64192f8722e08d68e032e Co-authored-by: glepnir <glephunter@gmail.com>
| * vim-patch:9.1.0618: cannot mark deprecated attributes in completion menuglepnir2024-07-27
| | | | | | | | | | | | | | | | | | | | | | | | Problem: cannot mark deprecated attributes in completion menu Solution: add hl_group to the Dictionary of supported completion fields (glepnir) closes: vim/vim#15314 https://github.com/vim/vim/commit/508e7856ec4afc9d6038b14bb6893668268dccab Co-authored-by: glepnir <glephunter@gmail.com>
* | fix(version): return nil with empty stringMaria José Solano2024-07-27
| |
* | vim-patch:9.1.0616: filetype: Make syntax highlighting off for MS Makefiles ↵zeertzjq2024-07-27
|/ | | | | | | | | | | | | | | | | | | | | | | | (#29874) Problem: filetype: Make syntax highlighting off for MS Makefiles Solution: Try to detect MS Makefiles and adjust syntax rules to it. (Ken Takata) Highlighting of variable expansion in Microsoft Makefile can be broken. E.g.: https://github.com/vim/vim/blob/2979cfc2627d76a9c09cad46a1647dcd4aa73f5f/src/Make_mvc.mak#L1331 Don't use backslash as escape characters if `make_microsoft` is set. Also fix that `make_no_comments` was not considered if `make_microsoft` was set. Also add description for `make_microsoft` and `make_no_comments` to the documentation and include a very simple filetype test closes: vim/vim#15341 https://github.com/vim/vim/commit/eb4b903c9b238ebcc1d14cfcb207129b4931a33d Co-authored-by: Ken Takata <kentkt@csc.jp>
* fix(plines): don't count invalidated virt text in char size (#29863)zeertzjq2024-07-26
| | | | | | Also: - Remove mt_end() and MT_FLAG_DECOR_VIRT_TEXT_INLINE checks, as they are already checked by marktree_itr_check_filter(). - Move ns_in_win() to the last check in decor_redraw_col().
* fix(decor): don't draw invalidated virtual lines (#29858)luukvbaal2024-07-26
|
* vim-patch:8.2.3543: swapname has double slash when 'directory' ends in it ↵zeertzjq2024-07-26
| | | | | | | | | | | | | (#29862) Problem: Swapname has double slash when 'directory' ends in double slash. (Shane Smith) Solution: Remove the superfluous slash. (closes vim/vim#8876) https://github.com/vim/vim/commit/8b0e62c93b6dad5ec5b2c7558d4f7b78c46216d2 The test got lost in #29758... Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.1.0617: Cursor moves beyond first line of folded end of buffer ↵luukvbaal2024-07-26
| | | | | | | | | | (#29859) Problem: Cursor moves beyond start of a folded range at the end of a buffer. Solution: Move cursor to start of fold when going beyond end of buffer. Check that cursor moved to detect FAIL in outer cursor function. (Luuk van Baal) https://github.com/vim/vim/commit/dc373d456b5919ed2b8f83e8642c115f646ca93d