aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui
Commit message (Collapse)AuthorAge
* revert: "refactor(win_close): remove "force", don't pass on "free_buf" ↵zeertzjq2023-01-24
| | | | | | | | (#21921)" (#21979) This reverts commit 0371d0f7afa5e01dd2ac8bbd3abcf0f7454872b3. > 'bufhidden' option exists. I don't think we should assume autoclosing windows are fine just because 'hidden' is set.
* refactor(win_close): remove "force", don't pass on "free_buf" (#21921)zeertzjq2023-01-23
| | | | | | | | | | | | | Problem: The "force" flag of win_close() complicates the code and adds edge cases where it is not clear what the correct behavior should be. The "free_buf" flag of win_close() is passed on to float windows when closing the last window of a tabpage, which doesn't make much sense. Solution: Remove the "force" flag and always close float windows as if :close! is used when closing the last window of a tabpage, and set the "free_buf" flag for a float window based on whether its buffer can be freed. As 'hidden' is on by default, this change shouldn't affect many people.
* fix(extmarks): problems with folded virtual lines (#21930)luukvbaal2023-01-23
| | | | | | | | | | | | | | Problem: When a folded line has virtual lines attached, the following problems occur: - The virtual lines are drawn empty. - The 'foldtext' line is drawn empty. - The cursor is drawn incorrectly. Solution: Check whether virtual lines belong to a folded line. Fix #17027 Fix #19557 Fix #21837 Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* vim-patch:8.2.0382: some tests fail when run under valgrind (#21936)zeertzjq2023-01-21
| | | | | | | | | | Problem: Some tests fail when run under valgrind. Solution: Increase timeouts. https://github.com/vim/vim/commit/353c351bd22e4dac4c3ae9cd7731032348f248c4 Cherry-pick Test_pum_with_preview_win() from patch 8.2.0011. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* perf(statuscolumn): only fill click defs array once per redraw (#21884)luukvbaal2023-01-20
| | | | | | | | | | | Problem: 'statuscolumn' click definitions are cleared, evaluated, allocated and filled each redraw for every row in a window. This despite the fact that we only store a single click definition array for the entire column as opposed to one for each row. Solution: Only fill the 'statuscolumn' click definition array once per window per redraw. Resolve https://github.com/neovim/neovim/issues/21767.
* vim-patch:8.2.4655: cmdline completion popup menu positioned wrong (#21894)zeertzjq2023-01-19
| | | | | | | | | | | | | Problem: Command line completion popup menu positioned wrong when using a terminal window. Solution: Position the popup menu differently when editing the command line. (Yegappan Lakshmanan, closes vim/vim#10050, closes vim/vim#10035) https://github.com/vim/vim/commit/1104a6d0c2004d39e9b6cb8f804d12b628a69869 The test in the patch looks a bit hard to understand. Add a Lua test that is more straightforward. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* fix(statusline): don't leak memory with truncated click labelszeertzjq2023-01-19
|
* fix(statusline): don't leak memory with zero-width click labelszeertzjq2023-01-19
| | | | | A zero-width click label isn't assigned to any click definition, so its function name should be freed when filling click definitions.
* fix(statuscolumn): always fill click defs array (#21878)zeertzjq2023-01-18
| | | | | | | | Click definitions are always filled for tabline, statusline and winbar, so they should also be always filled for statuscolumn, otherwise it will leak memory. Note: this doesn't actually change the existing code much, because of a typo in the existing code.
* fix(tabline): avoid memory leak in tabline click definitions (#21847)luukvbaal2023-01-17
| | | | | | Problem: Memory is leaked in tabline click definitions since https://github.com/neovim/neovim/pull/21008. Solution: Add back a call to `stl_clear_click_defs()` that was lost in the refactor PR.
* test(statuscolumn): %l should follow default wrap behavior (#21766)Brian Koropoff2023-01-17
|
* fix(column): avoid drawing columns for virt_lines_leftcolLuuk van Baal2023-01-16
| | | | | | | | Problem: The default fold column, as well as the 'statuscolumn', were drawn unnecessarily/unexpectedly for virtual lines placed with `virt_lines_leftcol` set. Solution: Skip the column states if a virtual line with `virt_lines_leftcol` set will be drawn.
* fix(column)!: ensure 'statuscolumn' works with virtual and wrapped linesLuuk van Baal2023-01-16
| | | | | | | | | | Problem: The `'statuscolumn'` was not re-evaluated for wrapped lines, when preceded by virtual/filler lines. There was also no way to distinguish virtual and wrapped lines in the status column. Solution: Make sure to rebuild the statuscolumn, and replace variable `v:wrap` with `v:virtnum`. `v:virtnum` is negative when drawing virtual lines, zero when drawing the actual buffer line, and positive when drawing the wrapped part of a buffer line.
* refactor: remove E5500, adjust testszeertzjq2023-01-16
| | | | | | Now with try_end() including more exception info, E5500 looks like redundant information. Adjust tests for more exception information.
* Merge pull request #21731 from tk-shirasaka/fix/builtin_popup_on_ext_popupmenubfredl2023-01-15
|\ | | | | fix: properly close builtin popup in ext_popupmenu
| * fix: properly close builtin popup in ext_popupmenushirasaka2023-01-11
| |
* | vim-patch:8.2.4579: cannot use page-up and page-down in the cmdline popup menuzeertzjq2023-01-15
| | | | | | | | | | | | | | | | | | | | | | Problem: Cannot use page-up and page-down in the command line completion popup menu. Solution: Check for to page-up and page-down keys. (Yegappan Lakshmanan, closes vim/vim#9960) https://github.com/vim/vim/commit/5cffa8df7e3c28681b9e5deef6df395784359b6b Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* | vim-patch:8.2.4341: command line not redrawn when finishing popup menu (#21792)zeertzjq2023-01-14
| | | | | | | | | | | | | | | | | | | | | | Problem: Command line not redrawn when finishing popup menu and the screen has scrolled up. Solution: Redraw the command line after updating the screen. (closes vim/vim#9722) https://github.com/vim/vim/commit/414acd342f4a66d930da34d419929985b48bd301 Code change is N/A as Nvim doesn't call update_screen() here. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* | fix(statuscolumn): make %l/%r respect 'number'/'relativenumber' (#21747)luukvbaal2023-01-13
| | | | | | Resolve https://github.com/neovim/neovim/issues/21745.
* | test: avoid consecutive mouse input at different positions (#21781)zeertzjq2023-01-13
| | | | | | | | The seconds call's position may override the first call if the first call isn't processed yet, defeating the purpose of the first call.
* | fix(ui): command line issues with external messages (#21709)luukvbaal2023-01-13
| | | | | | | | * fix: don't truncate external messages * fix: avoid resizing command line with external messages
* | fix(mouse): statusline click registered as statuscolumn (#21748)luukvbaal2023-01-13
| | | | | | | | | | | | | | | | fix(statuscolumn): statusline click registered as statuscolumn Problem: Status line click is registered as status status column click. Solution: Check that mouse is not on the status line. Resolve https://github.com/luukvbaal/statuscol.nvim/issues/4.
* | fix(statuscolumn): foldcolumn buffer is too small (#21761)luukvbaal2023-01-12
| | | | | | Resolve https://github.com/neovim/neovim/issues/21759.
* | fix(statuscolumn): fix sign column highlights (#21727)luukvbaal2023-01-11
|/ | | Resolve #21726.
* fix(statuscolumn): fix crashes and clang/PVS warnings (#21725)zeertzjq2023-01-10
|
* feat(float): open float relative to mouse #21531Sebastian Lyng Johansen2023-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: No easy way to position a LSP hover window relative to mouse. Solution: Introduce another option to the `relative` key in `nvim_open_win()`. With this PR it should be possible to override the handler and do something similar to this https://github.com/neovim/neovim/pull/19481#issuecomment-1193248674 to have hover information displayed from the mouse. Test case: ```lua local util = require('vim.lsp.util') local function make_position_param(window, offset_encoding) window = window or 0 local buf = vim.api.nvim_win_get_buf(window) local row, col local mouse = vim.fn.getmousepos() row = mouse.line col = mouse.column offset_encoding = offset_encoding or util._get_offset_encoding(buf) row = row - 1 local line = vim.api.nvim_buf_get_lines(buf, row, row + 1, true)[1] if not line then return { line = 0, character = 0 } end if #line < col then return { line = 0, character = 0 } end col = util._str_utfindex_enc(line, col, offset_encoding) return { line = row, character = col } end local make_params = function(window, offset_encoding) window = window or 0 local buf = vim.api.nvim_win_get_buf(window) offset_encoding = offset_encoding or util._get_offset_encoding(buf) return { textDocument = util.make_text_document_params(buf), position = make_position_param(window, offset_encoding), } end local hover_timer = nil vim.o.mousemoveevent = true vim.keymap.set({ '', 'i' }, '<MouseMove>', function() if hover_timer then hover_timer:close() end hover_timer = vim.defer_fn(function() hover_timer = nil local params = make_params() vim.lsp.buf_request( 0, 'textDocument/hover', params, vim.lsp.with(vim.lsp.handlers.hover, { silent = true, focusable = false, relative = 'mouse', }) ) end, 500) return '<MouseMove>' end, { expr = true }) ```
* fix(ui): set stc to empty in floatwin with minimal style (#21720)Raphael2023-01-10
| | | fix(ui): set stc to emtpy in floatwin with minimal style
* test(statuscolumn): add more tests for wrapped lines (#21718)zeertzjq2023-01-10
| | | | | | test(statuscolumn): add more tests more wrapped lines Also initialize a "relnum" variable to suppress a Coverity warning. The uninitialized value wasn't actually used by build_statuscol_str().
* feat(ui): add 'statuscolumn' optionluukvbaal2023-01-09
| | | | | | | | Problem: Unable to customize the column next to a window ('gutter'). Solution: Add 'statuscolumn' option that follows the 'statusline' syntax, allowing to customize the status column. Also supporting the %@ click execute function label. Adds new items @C and @s which will print the fold and sign columns. Line numbers and signs can be clicked, highlighted, aligned, transformed, margined etc.
* fix(ui): add test caseRaphael2023-01-09
|
* fix(diff): avoid restoring invalid 'foldcolumn' value (#21650)zeertzjq2023-01-05
| | | | Use "0" for 'foldcolumn' when w_p_fdc_save is empty, like how "manual" is used for 'foldmethod' when w_p_fdm_save is empty.
* Merge #21580 cmdline issues with cmdheight=0Justin M. Keyes2023-01-03
|\
| * test: add test cases for command line issuesLuuk van Baal2022-12-31
| |
* | fix(tui): more work in the TUIbfredl2022-12-31
|/
* fix(win_close): remove float grid after closing buffer (#21551)zeertzjq2022-12-27
| | | | It is not safe to remove the float grid when autocommands can still be triggered, as autocommands may use the float grid.
* fix(statusline): don't show showcmd when not enough space (#21550)zeertzjq2022-12-27
|
* fix(showcmd): assert failure with cmdheight=0 (#21536)zeertzjq2022-12-26
|
* 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.
* refactor(tui): use nvim_echo() for verbose terminfobfredl2022-12-20
| | | | | | This is needed for #18375 for the obvious reasons. note: verbose_terminfo_event is only temporarily needed until the full TUI process refactor is merged.
* fix(diff): handle long lines without crashing (#21389)Lewis Russell2022-12-12
| | | Fixes https://github.com/neovim/neovim/issues/21388
* test: convert another test in test_matchadd_conceal.vim to Lua (#21353)zeertzjq2022-12-09
|
* vim-patch:9.0.1030: using freed memory with the cmdline popup menuzeertzjq2022-12-09
| | | | | | | | | Problem: Using freed memory with the cmdline popup menu. Solution: Clear the popup menu when clearing the matches. (closes vim/vim#11677) https://github.com/vim/vim/commit/038e6d20e680ce8c850d07f6b035c4e1904c1201 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* fix(float): fix crash with bufpos and non-existent window (#21319)zeertzjq2022-12-07
|
* test: add more tests for float window bufpos (#21318)zeertzjq2022-12-07
|
* vim-patch:9.0.0969: matchparen highlight is not updated when switching ↵zeertzjq2022-11-29
| | | | | | | | | | | buffers (#21227) Problem: Matchparen highlight is not updated when switching buffers. Solution: Listen to the BufLeave and the BufWinEnter autocmd events. (closes vim/vim#11626) https://github.com/vim/vim/commit/28a896f54d4b2f2b4bef8ef4144dde1673c9d6e7 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* docs: fix typos (#21196)dundargoc2022-11-29
| | | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Raphael <glephunter@gmail.com> Co-authored-by: Gregory Anders <greg@gpanders.com>
* test: adding/removing winbar should not cause win_pos events (#21226)zeertzjq2022-11-29
|
* fix(tests): only get the color map once, even for multiple test filesbfredl2022-11-27
| | | | | | | | | Problem: test/functional/ui/screen.lua would be reloaded for each *_spec.lua file, which causes an extra nvim session to be started to get the color map each time. solution: Mark screen.lua as a preloaded file, but defer the loading of the color map to the first time Screen object is initialised.
* docs: fix typos (#21168)dundargoc2022-11-26
|
* vim-patch:8.2.2684: not enough folding code is testedzeertzjq2022-11-25
| | | | | | | | | | | | Problem: Not enough folding code is tested. Solution: Add more test cases. (Yegappan Lakshmanan, closes vim/vim#8046) https://github.com/vim/vim/commit/5c504f680e63120fea36becfabb8d939d4449e34 Reorder test_fold.vim to match upstream. Cherry-pick Test_fold_expr_error() from patch 8.2.0633. Cherry-pick syntax feature check from patch 8.2.1432. Cherry-pick a delete() call from patch 8.2.2112.