aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/highlight_spec.lua
Commit message (Collapse)AuthorAge
* fix(options): extend dry-run validationLewis Russell4 days
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: nvim_set_option_value() dry runs skip checks in did_set_* callbacks. This logic also prepares values needed to apply the option, such as tab widths or a compiled regexp. Moving the checks into validation callbacks needs a way to save that work for did_set_*. Solution: Store prepared values in optset_T so did_set_* can consume them after the option is stored. Dry runs perform the same validation, then free the prepared values without changing live state. This extends dry-run validation for: - 'cedit': reject invalid command-line window keys. - 'completeitemalign': require each completion column exactly once. - 'cursorlineopt': reject empty values and conflicting line modes. - 'encoding': accept only UTF-8 and its aliases. - 'fileencoding': reject lists and local changes with 'nomodifiable'. - 'messagesopt': require mandatory fields and enforce numeric limits. - 'spellcapcheck': return regexp errors, including under :silent!. - 'spellsuggest': reject conflicting suggestion modes. - 'varsofttabstop' and 'vartabstop': reject invalid tab widths. - 'wildmode': reject more than four completion stages. 'makeencoding' also uses the shared encoding preparation. Separating value preparation exposed a bug in 'vartabstop' and 'varsofttabstop': failed assignments could discard local tab widths, and global assignments could overwrite them. Fix this by preparing new widths separately and applying them only after a valid local assignment. AI-assisted
* fix(tabline): make TabLineFill base highlight group of default 'tabline'Sébastien Hoffmann2026-10-03
| | | | | | | | | | | | | | | | | | Follow-up to #41196 Problem: since #29976, the custom 'tabline' has a base highlight group TabLineFill that all %# highlights are automatically combined with. But the default C implementation still uses the TabLine and TabLineSel highlight groups uncombined, or rather effectively combined with Normal. Therefore, themes cannot depend on the base highlighting if they want to support both the default and custom tab lines. Solution: automatically combine TabLine and TabLineSel with TabLineFill in the default C implementation. fix https://github.com/neovim/neovim/issues/41173 ref https://github.com/neovim/neovim/pull/41196 ref https://github.com/neovim/neovim/pull/29976
* vim-patch:9.2.1114: Visual selection is not highlighted at the cursor ↵Takumi Katase2026-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | position #42105 vim-patch:9.2.1114: Visual selection is not highlighted at the cursor position Problem: In a terminal the character under the cursor is normally not shown as part of the visual selection. Solution: Don't set "noinvcur" in win_line() (Shane Harper). The problem did not occur in the GUI, only in a terminal. The name "noinvcur" ("don't invert the cursor") was misleading: the variable did not affect the cursor, but whether the character under the cursor could be displayed as part of the visual selection. The "noinvcur" handling may have been meant to help during a visual selection when Visual is shown in reverse video and the terminal draws the cursor by inverting the character under it, as otherwise the character under the cursor would not look highlighted like the rest of the selection. But Vim cannot know in general how a terminal draws the cursor, and when either the cursor is not drawn by inverting the character under it or Visual is not shown in reverse video, the handling just left a character of the visual selection unhighlighted. closes: vim/vim#21317 https://github.com/vim/vim/commit/d10aab4ba6602f8f2f2576d2d62ceb63869db6fb Co-authored-by: Shane Harper <shane@shaneharper.net> AI-assisted
* fix(mcursor): drop q= "follow motion" messageJustin M. Keyes2026-09-02
|
* fix(highlight): cterm default for Cursor hlgroupJustin M. Keyes2026-09-02
| | | | | | | | Problem: The `Cursor` highlight is invisible if 'termguicolors' is disabled. Solution: Change its default.
* vim-patch:9.2.0892: highlight: wrong column highlighted with 'cursorcolumn' ↵zeertzjq2026-08-02
| | | | | | | | | | | | | | | | | | | (#41110) Problem: With 'virtualedit' set to "all" and 'cursorcolumn' set, the wrong column may be highlighted after a command that moved the cursor into virtual space and back (van-de-bugger). Solution: Make sure the virtual column is up to date before drawing the window (Hirohito Higashi). fixes: vim/vim#2576 closes: vim/vim#20902 https://github.com/vim/vim/commit/5a90b9dbd2e1915b7aea98813316c7279e5dd27f Test only. This was already fixed by #39159. Co-authored-by: Hirohito Higashi <h.east.727@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* test(harness): migrate away from magic globalsJustin M. Keyes2026-07-21
| | | | | | | | | | | | | | | | | | | | | Problem: The magic globals `it`, `describe`, etc., are more trouble than they are worth. - Hooking into `after_each` requires `getfenv()` hacks. - They confuse luals/emmylua, because the top-level `.luarc.json` isn't merged with `test/.luarc.json` (apparently a luals limitation?) - They totally defeat discoverability because the user just has to "know" about the various magic symbols. So they harm DX, which means they serve no purpose at all. Solution: - Expose the test API from `testutil`, so tests can call `t.it()`, `t.describe()`, etc., in the conventional way. - Drop `getfenv()` hacks. - Drop the `setfenv()` injection in `load_chunk`. - Drop `test/_meta.lua`.
* fix(completion): update CursorColumn during completion (#39159)zeertzjq2026-04-17
| | | | Since Nvim uses a compositor, redrawing windows won't lead to flicker in the popup menu, so the pum_visible() checks in move.c can be removed.
* test: remove remaining use of feed_command() in terminal/ (#38069)zeertzjq2026-02-26
| | | Also deduplicate screen lines in some other tests.
* fix(highlight): refresh highlight attrs before message output #25737glepnir2026-02-17
| | | | | | | | | | | | Problem: When MsgArea highlight is changed, the next message may flash and disappear because msg_start() renders with stale highlight attributes. msg_puts_len() uses HL_ATTR(HLF_MSG) to render message text, which happens before update_screen() calls highlight_changed(). So the message is rendered with outdated attrs. Solution: Call highlight_changed() in msg_start().
* fix(highlight): respect 'winhighlight' in CursorLine Normal check #36927glepnir2025-12-16
| | | | | | | Problem: CursorLine background check used global `normal_bg`, ignoring 'winhighlight'. Solution: Use `bg_attr` to get window-local Normal background instead.
* fix(highlight): Normal-linked groups shouldn't override CursorLine #35026glepnir2025-12-09
| | | | | | | | Problem: CursorLine doesn't consistently highlight text using groups linked to Normal (e.g., in quickfix, passwd files), while it works for direct Normal usage. Solution: Don't let normal background from linked groups override explicit non-normal backgrounds during attribute combination.
* test: add a test for #36059zeertzjq2025-10-08
|
* vim-patch:9.1.1836: 'culopt' "screenline" not redrawn with line("w0") and :retabzeertzjq2025-10-08
| | | | | | | | | | | Problem: 'cursorlineopt' "screenline" isn't redrawn when moving cursor and then using line("w0") and :retab that does nothing. Solution: Call redraw_for_cursorcolumn() when setting a valid w_virtcol (zeertzjq). closes: vim/vim#18506 https://github.com/vim/vim/commit/a0849143614e687a305b6195dd8724840786e372
* vim-patch:9.1.1753: defaults: 'diffopt' option value can be improved (#35727)zeertzjq2025-09-12
| | | | | | | | | | | | | | | | | | | | | | | Problem: defaults: 'diffopt' option value can be improved Solution: Update diffopt defaults to include "indent-heuristic" and "inline:char" (Yee Cheng Chin) The default diff options have not been updated much despite new functionality having been added to Vim. - indent-heurstic: This has been enabled by default in Git since 33de716387 in 2017. Given that Vim uses xdiff from Git, it makes sense to track the default configuration from Git. - inline:char: This turns on character-wise inline highlighting which is generally much better than the default inline:simple. It has been implemented since vim/vim#16881 and we have not seen reports of any issues with it, and it has received good feedbacks. closes: vim/vim#18255 https://github.com/vim/vim/commit/976b365305c2e9025813ff3c7fe52f8d927fafc3 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* fix(redraw): update curswant for Visual selection (#34241)zeertzjq2025-05-30
| | | | | Problem: Blockwise Visual selection not redrawn correctly when moving cursor for more than 1 cells with 'virtualedit'. Solution: Restore the curswant update removed in 6679687bb3909f853ae97dfa01ae08ea2baf7f97.
* test: reduce flakiness in highlight tests (#32488)zeertzjq2025-02-17
|
* fix(tests): needing two calls to setup a screen is cringebfredl2024-11-14
| | | | | | | | | | Before calling "attach" a screen object is just a dummy container for (row, col) values whose purpose is to be sent as part of the "attach" function call anyway. Just create the screen in an attached state directly. Keep the complete (row, col, options) config together. It is still completely valid to later detach and re-attach as needed, including to another session.
* fix(options): fix 'winhl' still accepting invalid value (#30896)zeertzjq2024-10-22
|
* feat(ui): statusline text inherits highlights #29976Riley Bruins2024-10-12
| | | Changes apply to the winbar, statusline, and tabline text.
* vim-patch:9.1.0740: incorrect internal diff with empty file (#30471)zeertzjq2024-09-23
| | | | | | | | | | | | | | Problem: incorrect internal diff with an empty file Solution: Set pointer to NULL, instead of using an empty line file (Yukihiro Nakadaira) When using internal diff, empty file is read as one empty line file. So result differs from external diff. closes: vim/vim#15719 https://github.com/vim/vim/commit/f1694b439bb175d956b49da620f1253462ec507b Co-authored-by: Yukihiro Nakadaira <yukihiro.nakadaira@gmail.com>
* vim-patch:9.1.0729: Wrong cursor-screenline when resizing windowzeertzjq2024-09-14
| | | | | | | | | | Problem: Wrong cursor-screenline when resizing window Solution: Invalidate saved left_col and right_col when width1 or width2 change. closes: vim/vim#15679 https://github.com/vim/vim/commit/86dc4f8b432233a01d022c3e71df53db58229713
* test: improve test conventionsdundargoc2024-04-23
| | | | | | | | | Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
* refactor(test): inject after_each differentlyLewis Russell2024-04-10
|
* test: improve test conventionsdundargoc2024-04-08
| | | | Work on https://github.com/neovim/neovim/issues/27004.
* refactor(tests): use more standard colors but with extra colorsbfredl2024-04-05
|
* refactor(drawline): integrate terminal hl with eol loop (#27893)zeertzjq2024-03-17
| | | | | | | There is no test for using 'cursorline' in Normal mode in a terminal buffer, so add a test and fix 'cursorcolumn' remaining when entering Terminal mode. Also move synIDattr() tests to ui/highlight_spec.lua.
* fix(highlight): don't show CursorColumn on current line (#27848)zeertzjq2024-03-15
| | | | | | | | | | | | Problem: CursorColumn highlight behavior is inconsistent with 'virtualedit' set: - If cursor is on the text, CursorColumn is not shown. - If cursor is after end of line, CursorColumn is shown. Solution: Don't shown CursorColumn on current line if cursor is after end of line. Vim doesn't have this problem because in most cases it uses the code path for drawing buffer text when CursorColumn highlight is needed.
* vim-patch:b1427b46f5fe (#27652)zeertzjq2024-02-28
| | | | | | | | | | | | | runtime(vim): Update base-syntax, improve :echo highlighting (vim/vim#14103) - Normalise behaviour of :echo commands and improve expression matching. - Allow continued argument lines. - Refine string interpolation groups. - Remove duplicated :menu and :map generated commands that are handled specially later in the file. https://github.com/vim/vim/commit/b1427b46f5fe50a1daba102c4017d0ef2624b3ba Co-authored-by: dkearns <dougkearns@gmail.com>
* vim-patch:9.1.0106: Visual highlight hard to read with 'termguicolors'zeertzjq2024-02-15
| | | | | | | | | | | | | | | Problem: Visual highlight hard to read with 'termguicolors' (Maxim Kim) Solution: Set Visual GUI foreground to black (with background=light) and lightgrey (with background=dark) (Maxim Kim) fixes: vim/vim#14024 closes: vim/vim#14025 https://github.com/vim/vim/commit/34e4a05d02a016fe230495be8f6c60ddd56f9567 Co-authored-by: Maxim Kim <habamax@gmail.com>
* vim-patch:9.1.0083: Redrawing can be improved when deleting lines with 'number'zeertzjq2024-02-08
| | | | | | | | | | | Problem: Redrawing can be improved when inserting/deleting lines with 'number'. Solution: Only redraw the number column of lines below changed lines. Add a test as this wasn't previously tested. (zeertzjq) closes: vim/vim#13985 https://github.com/vim/vim/commit/ae07ebc04b0726e12b1af39d52e01d86ae79ef0a
* vim-patch:9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines ↵zeertzjq2024-02-06
| | | | | | | | | | | | | (#27363) Problem: LineNrAbove and LineNrBelow background wrong on wrapped lines. Solution: Update number column also for wrapped part of a line. (zeertzjq) closes: vim/vim#13974 https://github.com/vim/vim/commit/ebfd856cfdf6ea0b16c8d115000961c998ce97da Cherry-pick test_number.vim changes from patch 9.0.0626.
* docs: small fixes (#27213)dundargoc2024-02-06
| | | Co-authored-by: Matthieu Coudron <886074+teto@users.noreply.github.com>
* fix(redraw): update Visual selection properly with splits (#27343)zeertzjq2024-02-05
|
* test: rename (meths, funcs) -> (api, fn)Lewis Russell2024-01-12
|
* test: normalise nvim bridge functionsLewis Russell2024-01-12
| | | | | - remove helpers.cur*meths - remove helpers.nvim
* test: typing for helpers.methsLewis Russell2024-01-12
|
* refactor: format test/*Justin M. Keyes2024-01-03
|
* refactor(runtime): rewrite 'vim' color scheme in LuaEvgeni Chasnovski2023-12-21
| | | | | | | | | | Problem: Bundled 'vim' color scheme is written in Vimscript which implicitly assumes that the file is ported from Vim. This is not the case, at it is currently the Neovim's way of providing backward compatibility for color schemes. Solution: Rewrite it in Lua to indicate that this runtime file comes from Neovim.
* test: avoid repeated screen lines in expected stateszeertzjq2023-12-09
| | | | | | This is the command invoked repeatedly to make the changes: :%s/^\(.*\)|\%(\*\(\d\+\)\)\?$\n\1|\%(\*\(\d\+\)\)\?$/\=submatch(1)..'|*'..(max([str2nr(submatch(2)),1])+max([str2nr(submatch(3)),1]))/g
* fix(highlight): attr set all when normal attr changedglepnir2023-10-04
|
* fix(highlight): winhl receive wrong argumentglepnir2023-09-19
|
* test(extmarks): add tests for #14201 #20004 #20885 (#23794)zeertzjq2023-05-28
|
* fix(drawline): combine extmark highligh with area hl correctlybfredl2023-05-25
| | | | | | | | | | | | | | | | | | | fixes #23734 Get rid of the weird attr_pri dance which always seemed like a kludge: if (!attr_pri) { wlv.char_attr = hl_combine_attr(wlv.char_attr, extmark_attr); } else { wlv.char_attr = hl_combine_attr(extmark_attr, wlv.char_attr); } Instead combine extmark attrs with (old-skool) syntax attrs in a consistent way and then combine that with attr_pri and the rest in an _unified_ code path fixes #23722 Co-authored-by: luukvbaal <luukvbaal@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(highlight): combine ColorColumn with low-priority CursorLine (#23017)zeertzjq2023-04-11
|
* fix(highlight): use winhl=Foo:Bar even when Bar is emptybfredl2023-04-06
| | | | fixes #22906
* test(highlight_spec): fix warning in Visual highlight test (#22719)zeertzjq2023-03-18
| | | | Problem: Warning in Visual highlight test. Solution: Don't move cursor back and forth.
* test: use a wider screen in the rightleft winhl test (#22641)zeertzjq2023-03-12
| | | With a wide screen this actually previously caused an overflow.
* fix(screen): correctly draw background and eob with 'rightleft' (#22640)zeertzjq2023-03-12
|
* fix(options): restore exists() behavior for options (#21510)zeertzjq2022-12-23
| | | | | Duplicating get_option_value() logic for an obscure future refactor isn't really worthwhile, and findoption() isn't used anywhere else outside the options code.