aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui
Commit message (Collapse)AuthorAge
* perf(column): only invalidate lines affected by added signLuuk van Baal2023-11-29
|
* fix(decorations): do not apply sign highlight id as range attr idLuuk van Baal2023-11-29
|
* fix(column): redraw and update signcols for paired extmarkLuuk van Baal2023-11-28
| | | | | | Problem: Signcolumn width does not increase when ranged sign does not start at sentinel line. Solution: Handle paired range of added sign when checking signcols.
* feat(decoration): allow conceal_char to be a composing charbfredl2023-11-28
| | | | | | | | decor->text.str pointer must go. This removes it for conceal char, in preparation for a larger PR which will also handle the sign case. By actually allowing composing chars for a conceal chars, this becomes a feature and not just a refactor, as a bonus.
* fix(mouse): avoid dragging when clicking next to popupmenu (#26201)luukvbaal2023-11-25
|
* fix(messages): validate msg_grid before using msg_grid_pos (#26189)zeertzjq2023-11-24
|
* fix(mouse): avoid dragging after click label popupmenu callback (#26187)luukvbaal2023-11-24
|
* fix(column): reset decor state before starting from topLuuk van Baal2023-11-23
|
* test: remove the pipe created by new_pipename() (#26173)zeertzjq2023-11-23
|
* fix(column): apply numhl signs when 'signcolumn' is "no" (#26167)luukvbaal2023-11-23
|
* fix(decorations): fix imbalanced sign countbfredl2023-11-22
|
* refactor(decorations): break up Decoration struct into smaller piecesbfredl2023-11-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the monolithic Decoration struct. Before this change, each extmark could either represent just a hl_id + priority value as a inline decoration, or it would take a pointer to this monolitic 112 byte struct which has to be allocated. This change separates the decorations into two pieces: DecorSignHighlight for signs, highlights and simple set-flag decorations (like spell, ui-watched), and DecorVirtText for virtual text and lines. The main separation here is whether they are expected to allocate more memory. Currently this is not really true as sign text has to be an allocated string, but the plan is to get rid of this eventually (it can just be an array of two schar_T:s). Further refactors are expected to improve the representation of each decoration kind individually. The goal of this particular PR is to get things started by cutting the Gordian knot which was the monolithic struct Decoration. Now, each extmark can either contain chained indicies/pointers to these kinds of objects, or it can fit a subset of DecorSignHighlight inline. The point of this change is not only to make decorations smaller in memory. In fact, the main motivation is to later allow them to grow _larger_, but on a dynamic, on demand fashion. As a simple example, it would be possible to augment highlights to take a list of multiple `hl_group`:s, which then would trivially map to a chain of multiple DecorSignHighlight entries. One small feature improvement included with this refactor itself, is that the restriction that extmarks cannot be removed inside a decoration provider has been lifted. These are instead safely lifetime extended on a "to free" list until the current iteration of screen drawing is done. NB: flags is a mess. but DecorLevel is useless, this slightly less so
* fix(messages): :map output with ext_messages (#26126)Bara C. Tudor2023-11-22
|
* Merge pull request #25724 from luukvbaal/signmergebfredl2023-11-18
|\ | | | | refactor(sign): move legacy signs to extmarks
| * refactor(sign): move legacy signs to extmarksLuuk van Baal2023-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The legacy signlist data structures and associated functions are redundant since the introduction of extmark signs. Solution: Store signs defined through the legacy commands in a hashmap, placed signs in the extmark tree. Replace signlist associated functions. Usage of the legacy sign commands should yield no change in behavior with the exception of: - "orphaned signs" are now always removed when the line it is placed on is deleted. This used to depend on the value of 'signcolumn'. - It is no longer possible to place multiple signs with the same identifier in a single group on multiple lines. This will now move the sign instead. Moreover, both signs placed through the legacy sign commands and through |nvim_buf_set_extmark()|: - Will show up in both |sign-place| and |nvim_buf_get_extmarks()|. - Are displayed by increasing sign identifier, left to right. Extmark signs used to be ordered decreasingly as opposed to legacy signs.
* | refactor(grid): make screen rendering more multibyte than ever beforebfredl2023-11-17
|/ | | | | | | | | | | | | | | | | | Problem: buffer text with composing chars are converted from UTF-8 to an array of up to seven UTF-32 values and then converted back to UTF-8 strings. Solution: Convert buffer text directly to UTF-8 based schar_T values. The limit of the text size is now in schar_T bytes, which is currently 31+1 but easily could be raised as it no longer multiplies the size of the entire screen grid when not used, the full size is only required for temporary scratch buffers. Also does some general cleanup to win_line text handling, which was unnecessarily complicated due to multibyte rendering being an "opt-in" feature long ago. Nowadays, a char is just a char, regardless if it consists of one ASCII byte or multiple bytes.
* feat(tui): add 'termsync' option (#25871)Gregory Anders2023-11-14
| | | | | | | The 'termsync' option enables a mode (provided the underlying terminal supports it) where all screen updates during a redraw cycle are buffered and drawn together when the redraw is complete. This eliminates tearing or flickering in cases where Nvim redraws slower than the terminal redraws the screen.
* docs: deprecate the "term_background" UI fieldGregory Anders2023-11-13
|
* feat(statuscolumn): re-evaluate for every screen line (#25885)luukvbaal2023-11-13
| | | | | Problem: v:virtnum is less useful than it could be. Solution: Always re-evaluate 'statuscolumn', and update v:virtnum accordingly.
* feat(lsp)!: vim.lsp.inlay_hint.get(), enable(), is_enabled() #25512LW2023-11-12
| | | | | | | | | | | | | | | | | | refactor!: `vim.lsp.inlay_hint()` -> `vim.lsp.inlay_hint.enable()` Problem: The LSP specification allows inlay hints to include tooltips, clickable label parts, and code actions; but Neovim provides no API to query for these. Solution: Add minimal viable extension point from which plugins can query for inlay hints in a range, in order to build functionality on top of. Possible Next Steps --- - Add `virt_text_idx` field to `vim.fn.getmousepos()` return value, for usage in mappings of `<LeftMouse>`, `<C-LeftMouse>`, etc
* fix(float): apply 'winblend' to title/footer highlight (#25999)zeertzjq2023-11-12
|
* fix(highlight): apply 'winblend' to float border (#25981)zeertzjq2023-11-11
|
* fix(f_wait): flush UI before blocking (#25962)zeertzjq2023-11-10
|
* fix(options): do not change inccommand during preview (#25462)Omar El Halabi2023-11-09
|
* test(ui/decorations_spec): avoid flakiness caused by undo msg (#25924)zeertzjq2023-11-07
|
* feat(extmarks): add "undo_restore" flag to opt out of undo-restoringbfredl2023-11-05
| | | | | | | | | | | | | | | It is a design goal of extmarks that they allow precise tracking of changes across undo/redo, including restore the exact positions after a do/undo or undo/redo cycle. However this behavior is not useful for all usecases. Many plugins won't keep marks around for long after text changes, but uses them more like a cache until some external source (like LSP semantic highlights) has fully updated to changed text and then will explicitly readjust/replace extmarks as needed. Add a "undo_restore" flag which is true by default (matches existing behavior) but can be set to false to opt-out of this behavior. Delete dead u_extmark_set() code.
* refactor(grid): implement rightleftcmd as a post-processing stepbfredl2023-11-03
| | | | | | | Previously, 'rightleftcmd' was implemented by having all code which would affect msg_col or output screen cells be conditional on `cmdmsg_rl`. This change removes all that and instead implements rightleft as a mirroring post-processing step.
* test(ui/embed_spec): make sure server is started (#25880)zeertzjq2023-11-03
|
* fix(startup): trigger UIEnter for the correct channel (#25860)zeertzjq2023-11-01
|
* feat(server): allow embed with listen (#25709)George Harker2023-11-01
| | | | | | connection from any channel or stdio will unblock remote_ui_wait_for_attach. Wait on stdio only if only —embed specified, if both —embed and —listen then wait on any channel.
* fix(float): win_get_bordertext_col returning negative column number (#25752)nwounkn2023-10-26
| | | | | | | | Problem: `win_get_bordertext_col` returns column < 1 for right or center aligned text, if its length is more than window width. Solution: Return max(resulting_column, 1)
* fix(move): check the correct buffer (#25698)zeertzjq2023-10-18
|
* vim-patch:8.2.4497: wrong color for half of wide character next to pum ↵zeertzjq2023-10-18
| | | | | | | | | | scrollbar (#25693) Problem: Wrong color for half of wide character next to pum scrollbar. Solution: Redraw the screen cell with the right color. (closes vim/vim#9874) https://github.com/vim/vim/commit/35d8c2010ea6ee5c9bcfa6a8285648172b92ed83 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.2035: [security] use-after-free with wildmenu (#25687)zeertzjq2023-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: [security] use-after-free with wildmenu Solution: properly clean up the wildmenu when exiting Fix wildchar/wildmenu/pum memory corruption with special wildchar's Currently, using `wildchar=<Esc>` or `wildchar=<C-\>` can lead to a memory corruption if using wildmenu+pum, or wrong states if only using wildmenu. This is due to the code only using one single place inside the cmdline process loop to perform wild menu clean up (by checking `end_wildmenu`) but there are other odd situations where the loop could have exited and we need a post-loop clean up just to be sure. If the clean up was not done you would have a stale popup menu referring to invalid memory, or if not using popup menu, incorrect status line (if `laststatus=0`). For example, if you hit `<Esc>` two times when it's wildchar, there's a hard-coded behavior to exit command-line as a failsafe for user, and if you hit `<C-\><C-\><C-N>` it will also exit command-line, but the clean up code would not have hit because of specialized `<C-\>` handling. Fix Ctrl-E / Ctrl-Y to not cancel/accept wildmenu if they are also used for 'wildchar'/'wildcharm'. Currently they don't behave properly, and also have potentially memory unsafe behavior as the logic is currently not accounting for this situation and try to do both. (Previous patch that addressed this: vim/vim#11677) Also, correctly document Escape key behavior (double-hit it to escape) in wildchar docs as it's previously undocumented. In addition, block known invalid chars to be set in `wildchar` option, such as Ctrl-C and `<CR>`. This is just to make it clear to the user they shouldn't be set, and is not required for this bug fix. closes: vim/vim#13361 https://github.com/vim/vim/commit/8f4fb007e4d472b09ff6bed9ffa485e0c3093699 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* vim-patch:9.0.2037: A few remaining cmdline completion issues with C-E/Y ↵zeertzjq2023-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#25686) Problem: A few remaining cmdline completion issues with C-E/Y Solution: Fix cmdline completion fuzzy/Ctrl-E/Ctrl-Y/options when not used at the end Fix cmdline completion fuzzy/Ctrl-E/Ctrl-Y/options when not used at the end A few places in the cmdline completion code only works properly when the user hits Tab (or 'wildchar') at the end of the cmdline, even though it's supposed to work even in the middle of the line. For fuzzy search, `:e ++ff`, and `:set hl=`, fix completion code to make sure to use `xp_pattern_len` instead of assuming the entire `xp_pattern` is the search pattern (since it contains texts after the cursor). Fix Ctrl-E / Ctrl-Y to not jump to the end when canceling/accepting a wildmenu completion. Also, make them work even when not using `set wildoptions+=pum` as there is no drawback to doing so. (Related issue where this was brought up: vim/vim#13331) closes: vim/vim#13362 https://github.com/vim/vim/commit/209ec90b9b9bd948d76511c9cd2b17f47a97afe6 Cherry-pick ex_getln.c changes from patch 9.0.2035. Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* fix(extmarks): skip virt_text if it is out of window (#25658)zeertzjq2023-10-15
|
* vim-patch:9.0.2032: cannot get mouse click pos for tab or virt text (#25653)zeertzjq2023-10-15
| | | | | | | | | Problem: Cannot accurately get mouse clicking position when clicking on a TAB or with virtual text. Solution: Add a "coladd" field to getmousepos() result. closes: vim/vim#13335 https://github.com/vim/vim/commit/f5a94d5165bb9e390797da50a1fa7a87df3fbee4
* fix(ui): empty line before the next message after :silent commandnwounkn2023-10-14
| | | | | | | | | | Problem: The next command after `silent !{cmd}` or `silent lua print('str')` prints an empty line before printing a message, because these commands set `msg_didout = true` despite not printing any messages. Solution: Set `msg_didout = true` only if `msg_silent == 0`
* test(ui/searchhl_spec): match more in :terminal test (#25631)zeertzjq2023-10-14
|
* vim-patch:8.1.0822: peeking and flushing output slows down execution (#25629)zeertzjq2023-10-14
| | | | | | | Problem: Peeking and flushing output slows down execution. Solution: Do not update the mode message when global_busy is set. Do not flush when only peeking for a character. (Ken Takata) https://github.com/vim/vim/commit/cb574f415486adff645ce384979bfecf27f5be8c
* fix: allow multiline message for echoerr (#25380)Jongwook Choi2023-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PROBLEM: Currently `:echoerr` prints multi-line strings in a single line as `:echom` does (Note: `:echon` can print multi-line strings well). This makes stacktrace printed via echoerr difficult to read. Example code: try lua error("lua stacktrace") catch echoerr v:exception endtry Output: Error detected while processing a.vim[5]..a.vim: line 4: Vim(lua):E5108: Error executing lua [string ":lua"]:1: lua stacktrace^@stack traceback:^@^I[C]: in function 'error'^@^I[string ":lua"]:1: in main chunk SOLUTION: Allow echoerr to print multiline messages (e.g., lua exceptions), because this command is usually used to print stacktraces. Output after the fix: Error detected while processing a.vim[5]..a.vim: line 4: Vim(lua):E5108: Error executing lua [string ":lua"]:1: lua stacktrace stack traceback: [C]: in function 'error' [string ":lua"]:1: in main chunk
* refactor(float): rename ex_floatclose to ex_fclose (#25596)Raphael2023-10-11
|
* Merge pull request #25561 from glepnir/9663bfredl2023-10-10
|\ | | | | feat(float): add fclose command
| * feat(float): add fclose commandglepnir2023-10-10
| |
* | fix(highlight): add `FloatFooter` to 'highlight_defs.h' (#25577)Evgeni Chasnovski2023-10-10
| |
* | feat(ui-ext): make 'mousehide' into proper ui_option (#25532)Jaehoon Hwang2023-10-09
| |
* | test(ui/embed_spec): use notification instead of request (#25555)zeertzjq2023-10-09
| | | | | | This avoid the hang mentioned in #24888, and also matches TUI better.
* | refactor(grid): do arabic shaping in one placebfredl2023-10-08
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | The 'arabicshape' feature of vim is a transformation of unicode text to make arabic and some related scripts look better at display time. In particular the content of a cell will be adjusted depending on the (original) content of the cells just before and after it. This is implemented by the arabic_shape() function in nvim. Before this commit, shaping was invoked in four different contexts: - when rendering buffer text in win_line() - in line_putchar() for rendering virtual text - as part of grid_line_puts, used by messages and statuslines and similar - as part of draw_cmdline() for drawing the cmdline This replaces all these with a post-processing step in grid_put_linebuf(), which has become the entry point for all text rendering after recent refactors. An aim of this is to make the handling of multibyte text yet simpler. One of the main reasons multibyte chars needs to be "parsed" into codepoint arrays of composing chars is so that these could be inspected for the purpose of shaping. This can likely be vastly simplified in many contexts where only the total length (in bytes) and width of composed char is needed.
* refactor(grid): get rid of unbatched grid_puts and grid_putcharbfredl2023-10-06
| | | | | | | | | | | | | | | This finalizes the long running refactor from the old TUI-focused grid implementation where text-drawing cursor was not separated from the visible cursor. Still, the pattern of setting cursor position together with updating a line was convenient. Introduce grid_line_cursor_goto() to still allow this but now being explicit about it. Only having batched drawing functions makes code involving drawing a bit longer. But it is better to be explicit, and this highlights cases where multiple small redraws can be grouped together. This was the case for most of the changed places (messages, lastline, and :intro)
* Merge pull request #25491 from glepnir/25474bfredl2023-10-04
|\ | | | | fix(highlight): attr set all when normal attr changed