aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/mouse_spec.lua
Commit message (Collapse)AuthorAge
* 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.
* refactor(tests): use more global highlight definitionsbfredl2024-11-11
|
* test: add test for key following ignored mouse move (#31104)zeertzjq2024-11-07
|
* perf(mouse): only generate <MouseMove> for a new cell positon (#31103)errael2024-11-07
| | | | Problem: Can receive dozens of <MouseMove> events for same cell position. #30965 Solution: Leverage check_multiclick() to detect if cell position is unchanged.
* fix(tabline): restore behavior of click after last tabpage (#30602)zeertzjq2024-10-01
| | | Also correct the comments about tabpage labels in custom tabline.
* vim-patch:9.1.0704: inserting with a count is inefficient (#30206)zeertzjq2024-09-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* fix(mouse): don't treat click on hsep as click on statusline (#29565)zeertzjq2024-07-05
| | | This allows showing popup menu when right-clicking on hsep or cmdline.
* 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.
* fix(mouse): click after eol with conceal and virtual text (#27897)zeertzjq2024-03-17
| | | | | 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.
* 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>
* test(ui/mouse_spec): make sure click is processed (#27412)zeertzjq2024-02-10
|
* test: use integers for API Buffer/Window/Tabpage EXT typesLewis Russell2024-01-16
|
* test: rename (meths, funcs) -> (api, fn)Lewis Russell2024-01-12
|
* test: typing for helpers.methsLewis Russell2024-01-12
|
* refactor: format test/*Justin M. Keyes2024-01-03
|
* feat(api): add forward and back mouse buttonsAmanda Graven2023-12-18
|
* 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
* 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
* vim-patch:9.0.1919: Wrong curswant when clicking on empty line or with vsplitszeertzjq2023-09-21
| | | | | | | | | | 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
* fix(extmarks): make empty "conceal" respect &conceallevel = 1 (#24785)zeertzjq2023-08-19
| | | This treats extmark conceal more like matchadd() conceal.
* test(ui/mouse_spec): mouse click with matchadd() concealed textzeertzjq2023-08-18
|
* vim-patch:9.0.1725: cursor pos wrong after concealed text with 'virtualedit'zeertzjq2023-08-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* fix(mouse): drag vsep of window with 'statuscolumn' (#24462)zeertzjq2023-07-24
| | | | | | 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'.
* fix(mouse): copy the line before syntax matching (#24320)zeertzjq2023-07-12
|
* refactor(options): deprecate nvim[_buf|_win]_[gs]et_optionLewis Russell2023-05-21
| | | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: famiu <famiuhaque@protonmail.com>
* vim-patch:8.2.4890: inconsistent capitalization in error messageszeertzjq2023-05-05
| | | | | | | | | 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>
* fix(mouse): fix popup menu position check with winbar (#23456)zeertzjq2023-05-03
|
* fix(pum): position properly with ext_multigrid (#23336)zeertzjq2023-04-27
|
* fix(statusline): also allow right click when 'mousemodel' is "popup*" (#23258)luukvbaal2023-04-25
| | | | | 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.
* fix(options): fix local 'sidescrolloff' doesn't work for mouse (#21162)zeertzjq2022-11-23
| | | Missing part of Vim patch 8.1.0864.
* vim-patch:9.0.0739: mouse column not correctly used for popup_setpos (#20729)zeertzjq2022-10-19
| | | | | | | | 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.
* fix(input): use click number of last click for mouse drag (#20300)zeertzjq2022-09-24
|
* feat(api): add "move" to nvim_input_mousezeertzjq2022-09-04
|
* fix(tests): remove irrelevant usage of display-=msgsepbfredl2022-08-17
| | | | | | | | 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.
* test: improve some input testszeertzjq2022-07-25
|
* fix(mouse): fix using uninitialized memory with K_MOUSEMOVE (#19480)zeertzjq2022-07-24
| | | Fix a mistake in the porting of Vim patch 8.0.1309.
* feat(defaults): mouse=nvi #19290matveyt2022-07-17
| | | | | | | | | | 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
* refactor(ui)!: link `VertSplit` to `Normal` by defaultFamiu Haque2022-05-15
| | | | | Avoids using `gui=reverse` on `VertSplit` and makes window separators look much nicer by default.
* fix(input): do not translate scroll keys into multiclickszeertzjq2022-04-02
|
* fix(mouse): correct dragged position in composed layoutBjörn Linse2021-10-04
|
* test: add a test for getmousepos()Daniel Steinberg2021-09-29
|
* ui: make 'mouse' handling in external UI more consistentBjörn Linse2021-01-01
| | | | | | | | | 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.
* A Mudholland Dr. RecastBjörn Linse2020-10-19
| | | | | The commit summary maybe does not make sense, but calling a function that does not wait on anything `wait()` makes even less sense.
* options: make 'fillchars' and 'listchars' global-localBjörn Linse2019-11-26
| | | | | | | | | These options were previously global. A global-local window option behaves closer to a global option "per default" (i e with :set), but still supports local behavior via :setl Also this restores back-compat for nvim_set_option("fcs", ...) which are currently broken on 0.4.x but worked in earlier versions
* tests/ui: remove unnecessary screen:detach()Björn Linse2019-10-13
| | | | | | | | | | | | | It is perfectly fine and expected to detach from the screen just by the UI disconnecting from nvim or exiting nvim. Just keep detach() in screen_basic_spec, to get some coverage of the detach method itself. This avoids hang on failure in many situations (though one could argue that detach() should be "fast", or at least "as fast as resize", which works in press-return already). Never use detach() just to change the size of the screen, try_resize() method exists for that specifically.
* tests/ui: cleanup illegitimate usages of "attr_ignore"Björn Linse2019-10-13
| | | | | "attr_ignore" is an anti-pattern, with snapshot_util() just include all the highlights already.
* test: fix screen assertionsJan Edmund Lazo2019-10-01
|
* tests: re-enable "tab drag in tabline to the left moves tab left" (#10588)Daniel Hahler2019-07-24
| | | Ref: https://github.com/neovim/neovim/pull/4874