aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/decorations_spec.lua
Commit message (Collapse)AuthorAge
* vim-patch:9.2.1163: tests: not enough tests for virtual text before ↵zeertzjq2026-10-04
| | | | | | | | | | | 'linebreak' (#42225) Problem: tests: not enough tests for virtual text before 'linebreak'. Solution: Add a new case that behaved incorrectly before patch 9.2.1162 (zeertzjq). closes: vim/vim#21426 https://github.com/vim/vim/commit/fbd316b43f1a58f19dc2bb9343d56d46ff1d468a
* fix(display): pad virtual text after listchars eol #41292Langning Zhang2026-10-03
| | | | | | | | | Problem: End-of-line virtual text is drawn directly after a displayed listchars eol character. Solution: Preserve the normal one-cell separator after the eol character. AI-assisted
* 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(api): leaked window set in nvim__ns_set() #41689Volodymyr Chernetskyi2026-09-04
| | | | | | | | | | | | | | | Problem: The early return for an invalid window handle bypasses the `set_destroy()` at the end of the block, so the set's backing allocation leaks whenever an earlier iteration already called `set_put()`. Triggered by `{ wins = { valid_win, 9999 } }`. Solution: Destroy the set before returning. The new test passes either way, since the leak is only visible to a sanitizer; it is there so the ASAN job covers the path. AI-assisted
* fix(plines): 'linebreak' ignores inline virtual text width #41227Freddie Haddad2026-08-22
| | | | | | | | | | | | Problem: With 'linebreak', a word is moved to the next screen line when it does not fit on the current one. The check measures only the buffer text, so inline virtual text anchored inside the word is not counted. The word is kept on a line it cannot fit, and the virtual text is split across the screen line boundary. Solution: Count the width of inline virtual text anchored within the word, so the check uses the width that is actually displayed.
* feat(extmark): virt_lines can highlight until EOL #41289Goldpigg2026-08-18
|
* fix(decor): highlight without 'hl_eol' bleeds into wrap gaps #41160Freddie Haddad2026-08-07
| | | | | | | | | | | | | | | | Problem: 'linebreak' filler and 'breakindent'/'showbreak' padding are screen cells with no buffer character behind them, yet a decoration draws over them whether or not it asked to cover such cells. A highlight bounded to its text then paints a tail out to the edge of the row, most visible on inline code spans from plugins. That same highlight already leaves the cells past the end of a line alone, so it treats identical cells two different ways. Solution: Only a decoration with 'hl_eol' draws the gaps, which is what the flag already means at the end of a line. A full-width background such as a fenced code block sets it and still covers them. Classic :syntax has no such flag and is unchanged.
* fix(decor): 'breakindent'/'showbreak' gap ignores active highlight #41073Freddie Haddad2026-08-03
| | | | | | | | | | | | | | | | | | | | Problem: 'breakindent' and 'showbreak' draw their own padding with no reference to whatever decoration or syntax highlight is currently active, so it goes unhighlighted even mid-highlight, not just past a real EOL. Gating this on the decoration's `hl_eol` flag (as an earlier version of this fix did) missed plain highlights with no `hl_eol` at all, which have the exact same problem. Solution: Snapshot decor_attr into decor_attr_save right before it can be reset by 'linebreak' filler handling, and pass it into handle_breakindent()/handle_showbreak_and_filler() to extend into their padding: it is not a real end of the highlight, just screen cells with no buffer text. Like the 'linebreak' filler, an underline/strikethrough/overline is excluded, since it looks like a broken line drawn over the gap. This also fixes 'breakindent' losing the highlight right after a real 'linebreak' word-push, since that reset otherwise leaked into the next row.
* 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`.
* test: virt_lines_overflow=wrap with virt_lines_leftcol (#40147)zeertzjq2026-06-09
|
* perf(extmark): fix performance regression for non-wrapped virt lineszeertzjq2026-06-08
|
* feat(extmark): virt_lines_overflow "wrap" and "auto"jreidx2026-06-08
| | | | | | Problem: Extmark has support for horizontal scrolling and truncating, but not wrapping. Solution: Extend virt_lines_overflow flags to support "wrap" and "auto" based on proposed changes in #18282.
* feat(treesitter/extmark): support removing a conceal highlight #35087Peter Cardenas2026-04-25
| | | | | | | | | Problem: Cannot remove a `@conceal` highlight when defined in highlights.scm. Solution: Support a `@noconceal` highlight that works similarly to `@nospell` where it overrides the conceal set on the range to remove it. Additionally, can set the conceal metadata field to false for the same behavior.
* fix(api): use standard error messagesJustin M. Keyes2026-03-16
|
* test: remove remaining use of feed_command() in terminal/ (#38069)zeertzjq2026-02-26
| | | Also deduplicate screen lines in some other tests.
* fix(extmark): wrong eol_right_align width calculation (#37034)glepnir2026-01-23
| | | | | | | | | Problem: Multiple eol_right_align virtual texts with different widths are incorrectly positioned. The lookahead loop uses `item` instead of `lookaheadItem` when checking kind and accessing data, causing all items to use the first item's width. Solution: Use `lookaheadItem->kind` and `lookaheadItem->data.vt` instead of `item->kind` and `item->data.vt` in the lookahead loop.
* fix(marks): wrong line('w$', win) with conceal_lines (#37047)Jaehwang Jung2025-12-22
| | | | | | | | | | | | | | | | | Background: Suppose a window has concealed lines, and sets conceallevel>2, concealcursor="". The concealed lines are displayed if the window is curwin and the cursor is on the those lines. Problem: line('w$', win) switches curwin to win, and then does validate_botline for curwin. It computes botline assuming the concealed lines displayed, resulting in a smaller value than the actual botline that the user sees. Solution: Evaluate line('w$', win) without switching curwin. Apply similar changes to other functions that switches curwin. Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* vim-patch:9.1.1922: Wrong virtcol('$') with virtual text at EOL (#36643)zeertzjq2025-11-21
| | | | | | | | | | Problem: Wrong virtcol('$') with virtual text at EOL (rickhowe). Solution: Also add 1 to end virtcol when there is virtual text. (zeertzjq) fixes: vim/vim#18761 closes: vim/vim#18762 https://github.com/vim/vim/commit/d434f6c2a571e1fda0582986c28a488e1dce8fff
* fix(conceal): check for concealed lines on invalid row (#36084)luukvbaal2025-10-09
| | | | Problem: May check for concealed lines on invalid line numbers. Solution: Move checks after line number validation.
* vim-patch:9.1.1798: Wrong display with 'sms' and long wrapped virt text at ↵zeertzjq2025-09-27
| | | | | | | | | | | | EOL (#35930) Problem: Wrong display with 'smoothscroll' and long wrapped virtual text at EOL. Solution: Handle w_skipcol inside long wrapped virtual text at EOL (zeertzjq). closes: vim/vim#18408 https://github.com/vim/vim/commit/d9318acc0223bafd3ed5e7f8cdde26328bf200e7
* fix(plines): count 'showbreak' in EOL inline virt_text in line size (#35921)zeertzjq2025-09-26
|
* fix(lua): don't leak timer when vim._watch.watch() fails (#35768)zeertzjq2025-09-15
| | | | | | | | This fixes the following warning in tests with ASAN or TSAN: -------- Running tests from test/functional/lua/watch_spec.lua RUN T4253 vim._watch watch() ignores nonexistent paths: 29.00 ms OK nvim took 2006 milliseconds to exit after last test This indicates a likely problem with the test even if it passed!
* perf: add on_range in treesitter highlightingvanaigr2025-08-28
|
* fix(column): missing redraw with virt_lines_leftcol (#34650)zeertzjq2025-06-26
| | | | Problem: Missing number column redraw with virt_lines_leftcol. Solution: Set virt_line_index to -1 when skipping a virtual line.
* test: format decoration_spec.lua (#34181)Gabriel Ford2025-05-26
| | | | | | Problem: Currently when I run `make format` this is the one file outside of my changes that isn't currently formatted. Solution: Format this file.
* fix(move): consume skipcol before revealing filler lines (#34143)luukvbaal2025-05-24
| | | | | Problem: When scrolling (the text) down with 'smoothscroll', filler lines are revealed before the text skipped with `w_skipcol`. Solution: Check `w_skipcol` before filler lines.
* fix(diagnostics): fixed virtual_text cursormoved autocmd error (#34017)Rijul Kapoor2025-05-21
|
* fix(decor): extmark highlight not applied (#33858)Artem2025-05-09
| | | | | | | Problem: If the only highlight present in the buffer is an extmark, and its end position is outside the screen, redraws that start on lines after the first line of the mark will consider the buffer as not having any highlights, and skip drawing the mark's highlight. Solution: Check the updated number of decor ranges.
* refactor(tests): lint decorations_spec, float_spec, multigrid_spec #33274Justin M. Keyes2025-05-06
| | | | | | | | | Problem: decorations_spec.lua, float_spec.lua, multigrid_spec.lua are not auto-formatted. Solution: Add a special `formatlua2` cmake target, which invokes `stylua` with an alternative `.stylua2.toml` config.
* feat(messages): cleanup Lua error messagesJustin M. Keyes2025-05-04
| | | | | "Error" in error messages is redundant. Just provide the context, don't say "Error ...".
* fix(display): adjust setting winline info for concealed lines (#33717)luukvbaal2025-05-01
| | | | | | | Problem: Wrong winline info after partial redraw. Setting `conceal_cursor_used` is unnecessarily spread out. Solution: Rather than adjusting `wl_lastlnum` for the previous winline, adjust it when setting the current winline. Set `conceal_cursor_used` when the current window is redrawn.
* fix(marks): wrong display after inserting/deleting lines #33389luukvbaal2025-04-11
| | | | | | | | | | | | | | | Problem: Lines to/from which virt_lines or inline virt_text may have moved are left valid. Similarly the modified region may be too small to account for moved decorations after inserting or deleting lines. `redrawOneLine()` can be replaced with a call to `changed_lines_redraw_buf()`. Solution: Invalidate the line after a change if there is virt_lines, or inline virt_text in the buffer with 'wrap' enabled. Extend the modified region for inserted or deleted lines if there may be decorations in the buffer. Remove `redrawOneLine()`. Simplify the logic for `changed_lines_invalidate_win()`. Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(display): scroll redrawing doesn't account for virt_lines above fold #33374luukvbaal2025-04-08
| | | | | | Problem: Logic computing the new height of the modified area does not take into account virtual lines attached to a folded line. Solution: Remove `hasFolding()` branch and let `plines_win_full()` do its job.
* fix(decor): enable decoration provider in on_start #33337luukvbaal2025-04-07
| | | | | | | | Problem: An on_win-disabled decoration provider is left disabled for the on_buf callback during the next redraw (if the provider does not subscribe to on_end). Solution: Move re-activation of the provider from after the on_end callback to before the on_start callback.
* fix(display): wrong cursor column with 'concealcursor' = "n" and virt_text ↵luukvbaal2025-04-01
| | | | | | | (#33218) Problem: Inline virtual text placed in a decor provider callback invalidates `w_virtcol`, which must be valid for `win_line()`. Solution: Call `validate_virtcol()` after "line" decor provider callbacks.
* fix(move): adjust for concealed lines above topline after scrolling up (#33211)luukvbaal2025-04-01
| | | | | | Problem: Scrolling up does not adjust `w_topline` for concealed lines directly above it, resulting in (non-visual) asymmetry when scrolling up/down. Solution: Adjust `w_topline` for concealed lines after scrolling up.
* fix(display): scroll logic does not take into account concealed topline (#33054)luukvbaal2025-03-27
|
* test(log): use tempfile for expected error logs #33017luukvbaal2025-03-23
|
* fix(log): unify error messages for vim.ui_attach/decor providers #33005luukvbaal2025-03-21
| | | | | | | Problem: Error messages that cause a vim.ui_attach() namespace to detach are not visible in the message history. Decoration provider and vim.ui_attach error messages are dissimilar. Solution: Emit vim.ui_attach() errors as an actual message in addition to logging it. Adjust error message format.
* fix(marks): ensure decor is removed with proper range (#32973)luukvbaal2025-03-19
| | | | | | | Problem: Paired mark whose end is in front of its start should not have its decor removed (as fixed by 72f630f9), but may still need to have its range redrawn. Solution: Still call `buf_decor_remove()` but ensure it is not called with an inverse range when `extmark_del()` is called on an end mark.
* fix(marks): issues with invalid marks and marks beyond eob (#32862)luukvbaal2025-03-16
| | | | | | | Problem: Marks that go beyond the end of the buffer, and paired marks whose end is in front of its start mark are added to and removed from the decor. This results in incorrect tracking of the signcolumn. Solution: Ensure such marks are not added to and removed from the decor.
* fix(marks): mark winline as invalid if change is in a concealed line (#32766)luukvbaal2025-03-07
| | | | Code that checks whether a `w_lines` entry has become invalid due to a change in a folded line should now also check for concealed lines.
* feat(defaults): jump between :terminal shell prompts with ]]/[[ #32736Gregory Anders2025-03-07
|
* fix(marks): wrong winline info for concealed line with below virt line (#32747)luukvbaal2025-03-06
| | | | | | | Problem: Skipping over a concealed line for which `win_line()` _should_ be called because it has `virt_lines_above = false` lines associated with it. Solution: Don't include such a line in `wl_lastlnum` from the line above.
* fix(display): correctly store winline info for concealed lines (#32656)luukvbaal2025-02-27
| | | Off-by-one error in storing last line number for a logical line.
* feat(marks): add conceal_lines to nvim_buf_set_extmark()Luuk van Baal2025-02-25
| | | | Implement an extmark property that conceals lines vertically.
* fix(marks): truncate double-width inline virt_text consistently (#32560)zeertzjq2025-02-21
| | | | - Fix wrong cursor position with 'listchars' "precedes". - Always show the '<' truncation character.
* test: adjust multibyte virtual text test (#32557)zeertzjq2025-02-21
| | | | Having more chars after a double-width char makes it easier to spot the bug where truncating it causes the pending chars to be lost.
* feat(marks): virtual lines support horizontal scrolling (#32497)zeertzjq2025-02-20
| | | | Add a new field `virt_lines_overflow` that enables horizontal scrolling for virtual lines when set to "scroll".
* fix(marks): handle composing in inline virt_text with 'nowrap' (#32477)zeertzjq2025-02-16
|