aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
...
* | fix(lua): avoid internal error when :luado deletes lines (#27262)zeertzjq2024-01-30
| |
* | vim-patch:9.1.0065: Segfault with CompleteChanged autocommand (#27261)zeertzjq2024-01-30
| | | | | | | | | | | | | | | | | | | | | | Problem: Segfault with CompleteChanged autocommand (markonm ) Solution: Test match->cp_prev for being NULL before accessing it closes: vim/vim#13929 https://github.com/vim/vim/commit/fef66301665027f1801a18d796f74584666f41ef Co-authored-by: Christian Brabandt <cb@256bit.org>
* | feat(api): add nvim_tabpage_set_win (#27222)Will Hopkins2024-01-29
| | | | | | | | Allows setting the current window of a non-current tabpage without switching tabpages.
* | feat(extmarks): subpriorities (relative to declaration order) (#27131)Gregory Anders2024-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "priority" field of extmarks can be used to set priorities of extmarks which dictates which highlight group a range will actually have when there are multiple extmarks applied. However, when multiple extmarks have the same priority, the only way to enforce an actual priority is through the order in which the extmarks are set. It is not always possible or desirable to set extmarks in a specific order, however, so we add a new "subpriority" field that explicitly enforces the ordering of extmarks that have the same priority. For now this will be used only to enforce priority of treesitter highlights. A single node in a treesitter tree may match multiple captures, in which case that node will have multiple extmarks set. The order in which captures are returned from the treesitter API is not _necessarily_ in the same order they are defined in a query file, so we use the new subpriority field to force that ordering. For now subpriorites are not documented and are not meant to be used by external code, and it only applies to ephemeral extmarks. We indicate the "private" nature of subpriorities by prefixing the field name with an "_".
* | fix(jumplist): Ctrl+o, Ctrl+i weird behavior when deleting buffers #25461vE5li2024-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: - Navigation is not always symmetric: pressing Ctrl+o n times followed by Ctrl+i n times does not always gets me back to where I started. - Invalid buffers are not skipped by Ctrl+i/o, I have to press Ctrl+i/o multiple times to get to the next/previous buffer. Solution: - Remove all entries of a buffer from the jump list when deleting it. - Don't add a new entry to the jump list if the next buffer to be displayed is already in the jump list. Closes #25365
* | test: more tests for nvim_tabpage_get_win (#27248)zeertzjq2024-01-29
| |
* | vim-patch:9.1.0060: Recorded register cannot be translated using keytrans() ↵zeertzjq2024-01-29
| | | | | | | | | | | | | | | | | | | | | | | | (#27247) Problem: Recorded register cannot be translated using keytrans() when it involves character search (iddqd505) Solution: Record a K_IGNORE instead of a K_NOP (zeertzjq) related: vim/vim#13916 closes: vim/vim#13925 https://github.com/vim/vim/commit/bf321806bf44d59f108fd7e5a0eaead04682701d
* | build(docs): separate lint job to validate vimdoc #27227Jongwook Choi2024-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Separate the lint job (`make lintdoc`) to validate runtime/doc, it is no longer as a part of functionaltest (help_spec). Build (cmake) and CI: - `make lintdoc`: validate vimdoc files and test-generate HTML docs. CI will run this as a part of the "docs" workflow. - `scripts/lintdoc.lua` is added as an entry point (executable script) for validating vimdoc files. scripts/gen_help_html.lua: - Move the tests for validating docs and generating HTMLs from `help_spec.lua` to `gen_help_html`. Added: - `gen_help_html.run_validate()`. - `gen_help_html.test_gen()`. - Do not hard-code `help_dir` to `build/runtime/doc`, but resolve from `$VIMRUNTIME`. Therefore, the `make lintdoc` job will check doc files on `./runtime/doc`, not on `./build/runtime/doc`. - Add type annotations for gen_help_html.
* | test(lua/snippet_spec): wait for completion menu (#27243)zeertzjq2024-01-28
| | | | | | | | This fixes the flakiness caused by typing a completion menu key when the completion menu hasn't showed up.
* | test(tui): add & improve tests for terminal queries (#27219)Gregory Anders2024-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problems: 1. The test case for querying truecolor support did not check which capabilities were queried 2. The test case for querying truecolor support checked `&termguicolors` in the Nvim test runner, not the child Nvim in the the embedded terminal 3. The test case for querying truecolor support did not actually respond to the XTGETTCAP requests. `'termguicolors'` is still enabled even without responding to this query because libvterm understands and responds to the DECRQSS request, but it is still good to respond to the query explicitly instead of depending on hidden libvterm behavior 4. No test case exists at all for OSC 52 Solution: Fix all of the problems listed above.
* | vim-patch:9.1.0049: Make "[Command Line]" a special buffer nameSean Dewar2024-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: E95 is possible if a buffer called "[Command Line]" already exists when opening the cmdwin. This can also happen if the cmdwin's buffer could not be deleted when closing. Solution: Un-name the cmdwin buffer, and give it a special name instead, similar to what's done for quickfix buffers and for unnamed prompt and scratch buffers. As a result, BufFilePre/Post are no longer fired when opening the cmdwin. Add a "command" key to the dictionary returned by getbufinfo() to differentiate the cmdwin buffer instead. (Sean Dewar) Cherry-pick test_normal changes from v9.0.0954. https://github.com/vim/vim/commit/1fb41032060df09ca2640dc49541f11062f6dfaa
* | vim-patch:9.1.0048: Abort opening cmdwin if autocmds screw things upSean Dewar2024-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Autocmds triggered from opening the cmdwin (in win_split and do_ecmd) can cause issues such as E199, as the current checks are insufficient. Solution: Commands executed from the cmdwin apply to the old curwin/buf, so they should be kept in a "suspended" state; abort if they've changed. Also abort if cmdwin/buf was tampered with, and check that curwin is correct. Try to clean up the cmdwin buffer (only if hidden and non-current to simplify things; the same approach is used when closing cmdwin normally), and add a beep. (Sean Dewar) Rename the old Test_cmdwin_interrupted() like in the patch (can be moved to test_cmdwin.vim when v9.0.0027 is ported). Move the error message to `e_active_window_or_buffer_changed_or_deleted`. https://github.com/vim/vim/commit/43b395ec2e7d24a067d7cb00109818b64da144a5
* | vim-patch:9.1.0047: issues with temp curwin/buf while cmdwin is openSean Dewar2024-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Things that temporarily change/restore curwin/buf (e.g: win_execute, some autocmds) may break assumptions that curwin/buf is the cmdwin when "cmdwin_type != 0", causing issues. Solution: Expose the cmdwin's real win/buf and check that instead. Also try to ensure these variables are NULL if "cmdwin_type == 0", allowing them to be used directly in most cases without checking cmdwin_type. (Sean Dewar) Reset and save `cmdwin_old_curwin` in a similar fashion. Apply suitable changes for API functions and add Lua tests. https://github.com/vim/vim/commit/988f74311c26ea9917e84fbae608de226dba7e5f
* | docs(lua): update ":{range}lua" docs + error message #27231Justin M. Keyes2024-01-27
|/ | | | | - `:lua (no file)` is misleading because `:lua` never takes a file arg, unlike `:source`. - Update various related docs.
* fix(events): check for WinResized/WinScrolled in terminal mode (#27226)zeertzjq2024-01-27
|
* fix(api): limit depth of nvim_cmd (#27225)zeertzjq2024-01-27
|
* test(tui_spec): get &background from child session directly (#27224)zeertzjq2024-01-27
|
* feat(ex_cmds): ranged :lua #27167luukvbaal2024-01-26
| | | | | | :{range}lua executes the specified lines in the current buffer as Lua code, regardless of its extension or 'filetype'. Close #27103
* revert: "feat(treesitter): add foldtext with treesitter highlighting"Till Bungert2024-01-27
| | | This reverts commit 9ce1623 in favor of #20750.
* vim-patch:9.1.0058: Cannot map Super Keys in GTK UI (#27204)zeertzjq2024-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Cannot map Super Keys in GTK UI (Casey Tucker) Solution: Enable Super Key mappings in GTK using <D-Key> (Casey Tucker) As a developer who works in both Mac and Linux using the same keyboard, it can be frustrating having to remember different key combinations or having to rely on system utilities to remap keys. This change allows `<D-z>` `<D-x>` `<D-c>` `<D-v>` etc. to be recognized by the `map` commands, along with the `<D-S-...>` shifted variants. ```vimrc if has('gui_gtk') nnoremap <D-z> u nnoremap <D-S-Z> <C-r> vnoremap <D-x> "+d vnoremap <D-c> "+y cnoremap <D-v> <C-R>+ inoremap <D-v> <C-o>"+gP nnoremap <D-v> "+P vnoremap <D-v> "-d"+P nnoremap <D-s> :w<CR> inoremap <D-s> <C-o>:w<CR> nnoremap <D-w> :q<CR> nnoremap <D-q> :qa<CR> nnoremap <D-t> :tabe<CR> nnoremap <D-S-T> :vs#<CR><C-w>T nnoremap <D-a> ggVG vnoremap <D-a> <ESC>ggVG inoremap <D-a> <ESC>ggVG nnoremap <D-f> / nnoremap <D-g> n nnoremap <D-S-G> N vnoremap <D-x> "+x endif ``` closes: vim/vim#12698 https://github.com/vim/vim/commit/92e90a1e102825aa9149262cacfc991264db05df Co-authored-by: Casey Tucker <dctucker@hotmail.com>
* vim-patch:9.1.0056: wrong number of trailing spaces inserted after blockwise putzeertzjq2024-01-26
| | | | | | | | | | | | | | | | | | | | | Problem: Incorrect number of trailing spaces inserted for multibyte characters when pasting a blockwise register in blockwise visual mode (VanaIgr) Solution: Skip over trailing UTF-8 bytes when computing the number of trailing spaces (VanaIgr) When pasting in blockwise visual mode, and the register type is <CTRL-V>, Vim aligns the text after the replaced area by inserting spaces after pasted lines that are shorter than the longest line. When a shorter line contains multibyte characters, each trailing UTF-8 byte's width is counted in addition to the width of the character itself. Each trailing byte counts as being 4 cells wide (since it would be displayed as <xx>). closes: vim/vim#13909 https://github.com/vim/vim/commit/6638ec8afa9875ff565020536954c424d5f6f27d Co-authored-by: VanaIgr <vanaigranov@gmail.com>
* vim-patch:9.1.0054: 'linebreak' may still apply to leading whitespacezeertzjq2024-01-26
| | | | | | | | | | | | | | Problem: 'linebreak' may still apply to leading whitespace (VanaIgr) Solution: Compare pointers instead of virtual columns. (zeertzjq) related: #27180 closes: vim/vim#13915 https://github.com/vim/vim/commit/703f9bc943a29d947869b5cb0370be2ac42d5ac9 Co-authored-by: VanaIgr <vanaigranov@gmail.com>
* fix(colorscheme): use explicit normal foreground in syntax groupsEvgeni Chasnovski2024-01-25
| | | | | | | | | | | | Problem: Some core syntax highlight groups are cleared with intention to always be shown without additional highlighting. This doesn't always work as intended, especially with fallback mechanism of @-groups. Example: `Statement`/`Keyword` group shown in help code blocks (`@markup.raw`) is shown as bold (from `Statement`) cyan (from `@markup.raw`) instead of bold grey. Solution: Explicitly use normal grey foreground in syntax groups where it was previously implicitly assumed.
* fix(runtime): update 'vim' color scheme to use new tree-sitter groupsEvgeni Chasnovski2024-01-25
|
* feat(ui): add support for OSC 8 hyperlinks (#27109)Gregory Anders2024-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extmarks can contain URLs which can then be drawn in any supporting UI. In the TUI, for example, URLs are "drawn" by emitting the OSC 8 control sequence to the TTY. On terminals which support the OSC 8 sequence this will create clickable hyperlinks. URLs are treated as inline highlights in the decoration subsystem, so are included in the `DecorSignHighlight` structure. However, unlike other inline highlights they use allocated memory which must be freed, so they set the `ext` flag in `DecorInline` so that their lifetimes are managed along with other allocated memory like virtual text. The decoration subsystem then adds the URLs as a new highlight attribute. The highlight subsystem maintains a set of unique URLs to avoid duplicating allocations for the same string. To attach a URL to an existing highlight attribute we call `hl_add_url` which finds the URL in the set (allocating and adding it if it does not exist) and sets the `url` highlight attribute to the index of the URL in the set (using an index helps keep the size of the `HlAttrs` struct small). This has the potential to lead to an increase in highlight attributes if a URL is used over a range that contains many different highlight attributes, because now each existing attribute must be combined with the URL. In practice, however, URLs typically span a range containing a single highlight (e.g. link text in Markdown), so this is likely just a pathological edge case. When a new highlight attribute is defined with a URL it is copied to all attached UIs with the `hl_attr_define` UI event. The TUI manages its own set of URLs (just like the highlight subsystem) to minimize allocations. The TUI keeps track of which URL is "active" for the cell it is printing. If no URL is active and a cell containing a URL is printed, the opening OSC 8 sequence is emitted and that URL becomes the actively tracked URL. If the cursor is moved while in the middle of a URL span, we emit the terminating OSC sequence to prevent the hyperlink from spanning multiple lines. This does not support nested hyperlinks, but that is a rare (and, frankly, bizarre) use case. If a valid use case for nested hyperlinks ever presents itself we can address that issue then.
* refactor: rewrite ruby provider in luadundargoc2024-01-24
|
* refactor: rewrite perl provider in luadundargoc2024-01-24
|
* fix(spell): always accept ':' as filename char in 'spellfile' (#27172)zeertzjq2024-01-24
| | | Follow-up to #25236
* vim-patch:9.1.0046: :drop does not re-use empty buffer (#27165)zeertzjq2024-01-24
| | | | | | | | | | | | | Problem: :drop does not re-use empty buffer (Rocco Mao) Solution: Make :drop re-use an empty buffer (Rocco Mao) fixes: vim/vim#13851 closes: vim/vim#13881 https://github.com/vim/vim/commit/f96dc8d07f752ddd96d1447d85278a85255a1462 Co-authored-by: Rocco Mao <dapeng.mao@qq.com>
* fix(sign): avoid deleting from sign map while looping over it (#27158)luukvbaal2024-01-24
|
* test: typing for screen.luaLewis Russell2024-01-23
| | | | | Very rough buts resolves most diagnostic errors and should provide some useful hovers.
* Merge pull request #27147 from bfredl/crash2bfredl2024-01-23
|\ | | | | fix(extmark): another "step out" case
| * fix(extmark): fix crash when stepping out from internal nodebfredl2024-01-23
| |
* | fix(treesitter): update @markup default linksChristian Clason2024-01-23
|/ | | | | | | | * use `Special` as default for `@markup.*`, especially `@markup.raw` and `@markup.math` (`@markup` itself is never used) * use `Structure` for `@markup.environment` * highlight all of `@markup.link` as Underlined (otherwise concealed links are invisible)
* fix(extmarks): crash with sign after many marksbfredl2024-01-23
| | | | fixes #27137
* vim-patch:9.1.0043: ml_get: invalid lnum when :s replaces visual selection ↵zeertzjq2024-01-23
| | | | | | | | | | | | | | | | (#27140) Problem: ml_get: invalid lnum when :s replaces visual selection (@ropery) Solution: substitute may decrement the number of lines in a buffer, so validate, that the bottom lines of the visual selection stays within the max buffer line fixes: vim/vim#13890 closes: vim/vim#13892 https://github.com/vim/vim/commit/7c71db3a58f658b4329b82ab603efa928d17bdbc Co-authored-by: Christian Brabandt <cb@256bit.org>
* refactor: rewrite python provider in luadundargoc2024-01-22
|
* fix(column): clear "b_signcols" when marktree is clearedLuuk van Baal2024-01-22
|
* perf(extmarks): add metadata for efficient filtering of special decorationsbfredl2024-01-22
| | | | | | | | | | | | | | | | | | This expands on the global "don't pay for what you don't use" rules for these special extmark decorations: - inline virtual text, which needs to be processed in plines.c when we calculate the size of text on screen - virtual lines, which are needed when calculating "filler" lines - signs, with text and/or highlights, both of which needs to be processed for the entire line already at the beginning of a line. This adds a count to each node of the marktree, for how many special marks of each kind can be found in the subtree for this node. This makes it possible to quickly skip over these extra checks, when working in regions of the buffer not containing these kind of marks, instead of before where this could just be skipped if the entire _buffer_ didn't contain such marks.
* feat(fold): transparent foldtextLewis Russell2024-01-22
| | | | | | | | | | | | | | | | | 'foldtext' can be set to an empty string to disable and render the line with: - extmark highlight - syntax highlighting - search highlighting - no line wrapping - spelling - conceal - inline virtual text - respects `fillchars:fold` Currently normal virtual text is not displayed Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(eval): properly support checking v:lua function in exists() (#27124)Raphael2024-01-22
|
* Merge pull request #26813 from VanaIgr/screen-pos-speedupzeertzjq2024-01-22
|\ | | | | | | | | | | | | perf: make screen size and position calculations more efficient N/A patches for version.c: vim-patch:9.1.0037: Calling get_breakindent_win() repeatedly when computing virtcol vim-patch:9.1.0038: Unnecessary loop in getvcol()
| * test: add screenpos() benchmarksVanaIgr2024-01-18
| |
* | test(core/channel_spec): fix lint failurezeertzjq2024-01-22
| |
* | test(core/channels_spec): fix variable namezeertzjq2024-01-22
| |
* | fix(rpc): assertion failure due to invalid msgpack inputnwounkn2024-01-21
| | | | | | | | | | | | | | | | | | Problem: rbuffer_consumed assertion fails if Unpacker fails to parse msgpack, because it doesn't consume bytes on errors Solution: Call rbuffer_consumed_compact only if Unpacker isn't closed
* | fix(extmarks): missing "spell" and "conceal" in details (#27116)zeertzjq2024-01-22
| |
* | feat(vim.version): add `vim.version.le` and `vim.version.ge`Jongwook Choi2024-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | - Problem: One cannot easily write something like, for example: `version_current >= {0, 10, 0}`; writing like `not vim.version.lt(version_current, {0, 10, 0})` is verbose. - Solution: add {`le`,`ge`} in addition to {`lt`,`gt`}. - Also improve typing on the operator methods: allow `string` as well. - Update the example in `vim.version.range()` docs: `ge` in place of `gt` better matches the semantics of `range:has`.
* | vim-patch:9.1.0042: Missing test for Chuck FiletypeChristian Clason2024-01-21
| | | | | | | | | | | | | | | | | | | | | | Problem: Missing test for Chuck filetype after commit 27a4632af6753 (Christian Clason) Solution: Add a filetype test https://github.com/vim/vim/commit/c1884c94c5d7246e53a83b03a35a66ce81b49f83 Co-authored-by: Christian Brabandt <cb@256bit.org>
* | feat(treesitter)!: new standard capture namesChristian Clason2024-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Sharing queries with upstream and Helix is difficult due to different capture names. Solution: Define and document a new set of standard captures that matches tree-sitter "standard captures" (where defined) and is closer to Helix' Atom-style nested groups. This is a breaking change for colorschemes that defined highlights based on the old captures. On the other hand, the default colorscheme now defines links for all standard captures (not just those used in bundled queries), improving the out-of-the-box experience.