summaryrefslogtreecommitdiffstatshomepage
path: root/test/functional/ui/mouse_spec.lua
AgeCommit message (Collapse)AuthorFiles
2025-09-13feat(ui): support grid=0 in nvim_input_mouse #32535fredizzimo1
Problem: Multigrid UIs have to find out which window to send the input by using the Nvim focus rules, which are not fully documented. Furthermore,`getmousepos()` has several problems when multigrid is enabled, with the main one being that screenrow and screencol are window relative instead of screen relative, due to the fact that the UI don't send any absolute coordinates. Solution: Allow passing 0 as grid to `nvim_input_mouse`, with absolute coordinates, which lets nvim determine the actual window to send the mouse input to. This works as long as nvim is in charge of the window positioning. If the UI repositions or resizes the windows, it can still pass the grid it determines like before.
2025-09-05refactor(tests): don't compare the full screen in mouse_specFred Sundvik1
Problem: Adding multigrid tests to `mouse_spec` requires all tests to test both the multigrid and non-multigrid screen state, which adds a lot of extra code. Solution: Instead of testing the full screen state, only test substrings of it.
2025-04-14fix(marks): clamp conceal_lines corrected line number #33464luukvbaal1
Problem: Line number corrected for conceal_lines may be set beyond eob when the last buffer line is concealed, causing ml_get errors. Solution: Avoid setting line number beyond eob.
2025-04-13fix(mouse): mouseclick after conceal_lines is miscalculated #33451luukvbaal1
Problem: Computed buffer line for mouse position does not take into account concealed lines on the reached row. Solution: Adjust for concealed lines at the end of the loop computing the buffer position.
2025-03-28fix(mouse): crash with click on win-separator in statusline (#33091)Shadman1
Problem: Clicking on window separator in statusline crashes Nvim due to out of bound memory access Solution: Check if the click location is within clicking range before applying it.
2024-11-14fix(tests): needing two calls to setup a screen is cringebfredl1
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.
2024-11-11refactor(tests): use more global highlight definitionsbfredl1
2024-11-07test: add test for key following ignored mouse move (#31104)zeertzjq1
2024-11-07perf(mouse): only generate <MouseMove> for a new cell positon (#31103)errael1
Problem: Can receive dozens of <MouseMove> events for same cell position. #30965 Solution: Leverage check_multiclick() to detect if cell position is unchanged.
2024-10-01fix(tabline): restore behavior of click after last tabpage (#30602)zeertzjq1
Also correct the comments about tabpage labels in custom tabline.
2024-09-01vim-patch:9.1.0704: inserting with a count is inefficient (#30206)zeertzjq1
Problem: inserting with a count is inefficient Solution: Disable calculation of the cursor position and topline, if a count has been used (Ken Takata) Optimize insertion when using :normal 10000ix. This patch optimizes the insertion with a large count (e.g. `:normal 10000ix`). It seems that calculation of the cursor position for a long line is slow and it takes O(n^2). Disable the calculation if not needed. Before: ``` $ time ./vim --clean -c 'normal 10000ix' -cq! real 0m1.879s user 0m1.328s sys 0m0.139s $ time ./vim --clean -c 'normal 20000ix' -cq! real 0m5.574s user 0m5.421s sys 0m0.093s $ time ./vim --clean -c 'normal 40000ix' -cq! real 0m23.588s user 0m23.187s sys 0m0.140s ``` After: ``` $ time ./vim --clean -c 'normal 10000ix' -cq! real 0m0.187s user 0m0.046s sys 0m0.093s $ time ./vim --clean -c 'normal 20000ix' -cq! real 0m0.217s user 0m0.046s sys 0m0.108s $ time ./vim --clean -c 'normal 40000ix' -cq! real 0m0.278s user 0m0.093s sys 0m0.140s $ time ./vim --clean -c 'normal 80000ix' -cq! real 0m0.494s user 0m0.311s sys 0m0.140s $ time ./vim --clean -c 'normal 160000ix' -cq! real 0m1.302s user 0m1.140s sys 0m0.094s ``` closes: vim/vim#15588 https://github.com/vim/vim/commit/09b80d23cfae24fa13ef4f52b0ec90625839a6ab Co-authored-by: Ken Takata <kentkt@csc.jp>
2024-07-05fix(mouse): don't treat click on hsep as click on statusline (#29565)zeertzjq1
This allows showing popup menu when right-clicking on hsep or cmdline.
2024-04-23test: improve test conventionsdundargoc1
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.
2024-04-10refactor(test): inject after_each differentlyLewis Russell1
2024-04-08test: improve test conventionsdundargoc1
Work on https://github.com/neovim/neovim/issues/27004.
2024-03-17fix(mouse): click after eol with conceal and virtual text (#27897)zeertzjq1
Problem: Wrong cursor position when clicking after end of line with 'virtualedit', conceal and virtual text. Solution: Always fill linebuf_vcol[] for the columns to clear.
2024-02-15vim-patch:9.1.0106: Visual highlight hard to read with 'termguicolors'zeertzjq1
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>
2024-02-10test(ui/mouse_spec): make sure click is processed (#27412)zeertzjq1
2024-01-16test: use integers for API Buffer/Window/Tabpage EXT typesLewis Russell1
2024-01-12test: rename (meths, funcs) -> (api, fn)Lewis Russell1
2024-01-12test: typing for helpers.methsLewis Russell1
2024-01-03refactor: format test/*Justin M. Keyes1
2023-12-18feat(api): add forward and back mouse buttonsAmanda Graven1
2023-12-09test: avoid repeated screen lines in expected stateszeertzjq1
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
2023-10-15vim-patch:9.0.2032: cannot get mouse click pos for tab or virt text (#25653)zeertzjq1
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
2023-09-21vim-patch:9.0.1919: Wrong curswant when clicking on empty line or with vsplitszeertzjq1
Problem: Wrong curswant when clicking on empty line or with vsplits. Solution: Don't check for ScreenCols[] before the start of the window and handle empty line properly. closes: vim/vim#13132 https://github.com/vim/vim/commit/03cd697d635f1b0e7ffe21cf8244a8fb755f2ddb
2023-08-19fix(extmarks): make empty "conceal" respect &conceallevel = 1 (#24785)zeertzjq1
This treats extmark conceal more like matchadd() conceal.
2023-08-18test(ui/mouse_spec): mouse click with matchadd() concealed textzeertzjq1
2023-08-18vim-patch:9.0.1725: cursor pos wrong after concealed text with 'virtualedit'zeertzjq1
Problem: Wrong cursor position when clicking after concealed text with 'virtualedit'. Solution: Store virtual columns in ScreenCols[] instead of text columns, and always use coladvance() when clicking. This also fixes incorrect curswant when clicking on a TAB, so now Test_normal_click_on_ctrl_char() asserts the same results as the ones before patch 9.0.0048. closes: vim/vim#12808 https://github.com/vim/vim/commit/e500ae8e29ad921378085f5d70ee5c0c537be1ba Remove the mouse_adjust_click() function. There is a difference in behavior with the old mouse_adjust_click() approach: when clicking on the character immediately after concealed text that is completely hidden, cursor is put on the clicked character rather than at the start of the concealed text. The new behavior is better, but it causes unnecessary scrolling in a functional test (which is an existing issue unrelated to these patches), so adjust the test. Now fully merged: vim-patch:9.0.0177: cursor position wrong with 'virtualedit' and mouse click
2023-07-24fix(mouse): drag vsep of window with 'statuscolumn' (#24462)zeertzjq1
Problem: Cannot drag a vertical separator to the right of a window whose 'statuscolumn' is wider than itself. Solution: Never treat a click on a vertical separator as a click on 'statuscolumn'.
2023-07-12fix(mouse): copy the line before syntax matching (#24320)zeertzjq1
2023-05-21refactor(options): deprecate nvim[_buf|_win]_[gs]et_optionLewis Russell1
Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: famiu <famiuhaque@protonmail.com>
2023-05-05vim-patch:8.2.4890: inconsistent capitalization in error messageszeertzjq1
Problem: Inconsistent capitalization in error messages. Solution: Make capitalization consistent. (Doug Kearns) https://github.com/vim/vim/commit/cf030578b26460643dca4a40e7f2e3bc19c749aa Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-03fix(mouse): fix popup menu position check with winbar (#23456)zeertzjq1
2023-04-27fix(pum): position properly with ext_multigrid (#23336)zeertzjq1
2023-04-25fix(statusline): also allow right click when 'mousemodel' is "popup*" (#23258)luukvbaal1
Problem: The 'statusline'-format ui elements do not receive right click events when "mousemodel" is "popup*" Solution: Do not draw popupmenu and handle click event instead.
2022-11-23fix(options): fix local 'sidescrolloff' doesn't work for mouse (#21162)zeertzjq1
Missing part of Vim patch 8.1.0864.
2022-10-19vim-patch:9.0.0739: mouse column not correctly used for popup_setpos (#20729)zeertzjq1
Problem: Mouse column not correctly used for popup_setpos. Solution: Adjust off-by-one error and handle Visual line selection properly. (Yee Cheng Chin, closes vim/vim#11356) https://github.com/vim/vim/commit/17822c507c03d509037c9ee5eee5cfbb201b3f01 The test_termcodes.vim test cannot be used. Use a Lua test instead.
2022-09-24fix(input): use click number of last click for mouse drag (#20300)zeertzjq1
2022-09-04feat(api): add "move" to nvim_input_mousezeertzjq1
2022-08-17fix(tests): remove irrelevant usage of display-=msgsepbfredl1
These were just added to avoid churn when changing the default of 'display'. To simplify message handling logic, we might want to remove support for printing messages in default_grid later on. This would allow things like printing error messages safely in the middle of redraw, or a future graduation of the 'multigrid' feature.
2022-07-25test: improve some input testszeertzjq1
2022-07-24fix(mouse): fix using uninitialized memory with K_MOUSEMOVE (#19480)zeertzjq1
Fix a mistake in the porting of Vim patch 8.0.1309.
2022-07-17feat(defaults): mouse=nvi #19290matveyt1
Problem: Since right-click can now show a popup menu, we can provide messaging to guide users who expect 'mouse' to be disabled by default. So 'mouse' can now be enabled by default. Solution: Do it. Closes #15521
2022-05-15refactor(ui)!: link `VertSplit` to `Normal` by defaultFamiu Haque1
Avoids using `gui=reverse` on `VertSplit` and makes window separators look much nicer by default.
2022-04-02fix(input): do not translate scroll keys into multiclickszeertzjq1
2021-10-04fix(mouse): correct dragged position in composed layoutBjörn Linse1
2021-09-29test: add a test for getmousepos()Daniel Steinberg1
2021-01-01ui: make 'mouse' handling in external UI more consistentBjörn Linse1
before the behaviour of 'mouse' was inconsistent in external UI, as some remapping logic would check has_mouse() and others don't (no difference in TUI or vim classic). With this change, the behaviour is consistently up to the UI decide (see ui.txt edit) Behaviour of tui.c is unaffected by this change.
2020-10-19A Mudholland Dr. RecastBjörn Linse1
The commit summary maybe does not make sense, but calling a function that does not wait on anything `wait()` makes even less sense.