aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mouse.c
Commit message (Collapse)AuthorAge
...
* 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: remove longdundargoc2023-07-03
| | | | | long is 32-bits even on 64-bit windows which makes the type suboptimal for a codebase meant to be cross-platform.
* fix(mouse): handle folded lines with virt_lines attached to line above (#23912)zeertzjq2023-06-05
|
* fix(mouse): fix popup menu position check with winbar (#23456)zeertzjq2023-05-03
|
* fix(ui): adjust 'smoothscroll' for inner dimensionsLuuk van Baal2023-05-02
|
* vim-patch:9.0.0911: with 'smoothscroll' set mouse click position may be wrongLuuk van Baal2023-05-02
| | | | | | | | | Problem: With 'smoothscroll' set mouse click position may be wrong. Solution: Adjust computations for w_skipcol. (Yee Cheng Chin, closes vim/vim#11514) https://github.com/vim/vim/commit/e6392b102151ec69fad232bcf00591230cef8e1c Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* vim-patch:9.0.0901: setting w_leftcol and handling side effects is confusingLuuk van Baal2023-05-02
| | | | | | | | | Problem: Setting w_leftcol and handling side effects is confusing. Solution: Use a function to set w_leftcol() and handle side effects. https://github.com/vim/vim/commit/0c34d562647f029faca40f7733ccfb7b5377672b Co-authored-by: Bram Moolenaar <Bram@vim.org>
* fix(mouse): fix popup_setpos position check with ext_multigrid (#23436)zeertzjq2023-05-02
|
* refactor: uncrustifydundargoc2023-04-26
| | | | Notable changes: replace all infinite loops to `while(true)` and remove `int` from `unsigned int`.
* 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(mouse): cmdline click registered as statuscolumn (#23163)luukvbaal2023-04-18
|
* refactor(screen): screen.c delenda estbfredl2023-03-14
| | | | | | | | | | | | | drawscreen.c vs screen.c makes absolutely no sense. The screen exists only to draw upon it, therefore helper functions are distributed randomly between screen.c and the file that does the redrawing. In addition screen.c does a lot of drawing on the screen. It made more sense for vim/vim as our grid.c is their screen.c Not sure if we want to dump all the code for option chars into optionstr.c, so keep these in a optionchar.c for now.
* refactor: reduce scope of locals as per the style guide (#22206)dundargoc2023-02-11
|
* refactor: replace char_u with char 22 (#21786)dundargoc2023-01-17
| | | Work on https://github.com/neovim/neovim/issues/459
* refactor: fix IWYU mapping file and use IWYU (#21802)dundargoc2023-01-15
| | | Also add the EXITFREE definition to main_lib rather than the nvim target, as the header generation needs the EXITFREE flag to work properly.
* refactor: replace char_u with char 21 (#21779)dundargoc2023-01-14
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* 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): fix crashes and clang/PVS warnings (#21725)zeertzjq2023-01-10
|
* 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.
* vim-patch:9.0.0259: crash with mouse click when not initialized (#21282)zeertzjq2022-12-04
| | | | | | | | Problem: Crash with mouse click when not initialized. Solution: Check TabPageIdxs[] is not NULL. https://github.com/vim/vim/commit/80525751c5ce9ed82c41d83faf9ef38667bf61b1 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* build: allow IWYU to fix includes for all .c filesdundargoc2022-11-15
| | | | | | | | | | Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers.
* refactor: move tabline code to statusline.c (#21008)luukvbaal2022-11-10
| | | | | | | | * refactor: move tabline code to statusline.c Problem: Tabline code is closely related to statusline, but still left over in drawscreen.c and screen.c. Solution: Move it to statusline.c. * refactor: add statusline_defs.h
* refactor: fix clang-tidy warningsdundargoc2022-11-06
| | | | | | | | Enable and fix bugprone-misplaced-widening-cast warning. Fix some modernize-macro-to-enum and readability-else-after-return warnings, but don't enable them. While the warnings can be useful, they are in general too noisy to enable.
* vim-patch:9.0.0825: cannot drag an entry in the tabpage linezeertzjq2022-11-02
| | | | | | | | | | Problem: Cannot drag an entry in the tabpage line. Solution: Clear dragwin instead of got_click. (closes vim/vim#11483, closes vim/vim#11482) https://github.com/vim/vim/commit/8e0ccb6bc21a446e5c6375b7fdf200fb53a129da Omit Test_term_mouse_drag_to_move_tab(): covered by ui/mouse_spec.lua.
* vim-patch:9.0.0822: crash when dragging the statusline with a mappingzeertzjq2022-11-02
| | | | | | | | | Problem: Crash when dragging the statusline with a mapping. Solution: Check for valid window pointer. (issue vim/vim#11427) https://github.com/vim/vim/commit/8ab9ca93eea32b318235384720200771863ecaee Co-authored-by: Bram Moolenaar <Bram@vim.org>
* refactor: move do_mouse() and its helpers to mouse.c (#20895)zeertzjq2022-11-01
| | | | Vim moved it in patch 8.1.2062, and this is required for patch 9.0.0822. Also change macros in mouse.h to enums.
* 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.
* refactor: replace char_u with charDundar Göc2022-09-06
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with charDundar Göc2022-08-31
| | | | Work on https://github.com/neovim/neovim/issues/459
* Merge pull request #19971 from dundargoc/refactor/remove-castsbfredl2022-08-29
|\ | | | | refactor: remove redundant casts
| * refactor: remove redundant castsDundar Göc2022-08-27
| |
* | refactor(plines): use a struct for chartabsize statebfredl2022-08-29
|/ | | | | | | | | This is a refactor extracted from vim-patch 9.0.0067: cannot show virtual text The logic for inline virtual text is going to be different in nvim than text property based text in vim, but this refactor is still useful, as calculation of displayed linesize is going to be stateful in a similar way.
* refactor: pre-incr to post-incrLewis Russell2022-08-25
|
* vim-patch:9.0.0206: redraw flags are not named specifically (#19913)zeertzjq2022-08-23
| | | | | Problem: Redraw flags are not named specifically. Solution: Prefix "UPD_" to the flags, for UPDate_screen(). https://github.com/vim/vim/commit/a4d158b3c839e96ed98ff87c7b7124ff4518c4ff
* vim-patch:8.1.2057: the screen.c file is much too bigLewis Russell2022-08-19
| | | | | | | | | | | | | | | Problem: The screen.c file is much too big. Solution: Split it in three parts. (Yegappan Lakshmanan, closes vim/vim#4943) https://github.com/vim/vim/commit/7528d1f6b5422750eb778dfb550cfd0b0e540964 This is an approximation vim-patch 8.1.2057. Applying the patch directly isn't feasible since our version of screen.c has diverged too much, however we still introduce drawscreen.c and drawline.c: - screen.c is now a much smaller file used for low level screen functions - drawline.c contains everything needed for win_line() - drawscreen.c contains everything needed for update_screen() Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* refactor: remove some unused includes (#19820)zeertzjq2022-08-17
| | | Replace grid.h in screen.h and screen.h in buffer.h with grid_defs.h
* refactor: change pre-decrement/increment to post (#19799)Lewis Russell2022-08-16
| | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix: right-click in clickable statusline #19252Famiu Haque2022-07-15
| | | | | | | | | | | | Problem: 1. Right-click does not work in statusline unless you left-click first (to focus the statusline). 2. Modifier (e.g. shift+rightclick) does not work in statusline. Solution: Make clickable statusline sections receive right-clicks regardless of whether the statusline is focused. Closes #18994
* feat: add 'mousescroll' option (#12355)Jay2022-07-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add 'mousescroll' option to control how many lines to scroll by when a mouse wheel keycode is received. The mousescroll option controls both horizontal and vertical scrolling. The option is a string in the format: set mousescroll=direction:count,direction:count Where direction is either "ver" or "hor", and count is a non negative integer. If a direction is omitted, a default value is used. The default values remain unchanged, that is 3 for vertical scrolling, and 6 for horizontal scrolling. As such, the mousescroll default is "ver:3,hor:6". Add mousescroll documentation - Add option documentation in options.txt - Add brief summary in quickref.txt Update :help scroll-mouse-wheel - Mention mousescroll option as a means of controlling scrolling. - Remove obsolete suggestion to map scroll wheel keys to <C-U> to scroll by a single line -- users should prefer the mousescroll option. - Add some information about the consequences of remapping scroll wheel keys (they lose their magic ability to affect inactive windows). Update :help vim-differences - Add brief mousescroll summary under Options Add mousescroll tests - Test option validation - Test default mousescroll value and behavior - Test fallback to default values - Test mouse vertical and horizontal scrolling in normal mode - Test mouse vertical and horizontal scrolling in insert mode
* vim-patch:8.0.1558: no right-click menu in a terminalzeertzjq2022-07-01
| | | | | | Problem: No right-click menu in a terminal. Solution: Implement the right click menu for the terminal. https://github.com/vim/vim/commit/aef8c3da2ba59285b7cfde559ae21cdce6ba6919
* refactor(uncrustify): set maximum number of consecutive newlines to 2 (#18695)dundargoc2022-05-25
|
* feat: click support for 'statusline', 'winbar' #18650Famiu Haque2022-05-23
| | | | The mouseclick item "%@" is now supported by 'statusline' and 'winbar'. Previously it was only supported by 'tabline'.
* fix(mouse): fix mouse drag position with winbar or border in multigridzeertzjq2022-05-19
|
* fix(mouse): fix mouse drag position with winbarzeertzjq2022-05-19
|
* Merge pull request #18620 from bfredl/multibarbfredl2022-05-18
|\ | | | | fix(ui): make winbar work with floats and multigrid
| * refactor: grid->rows and grid->colsbfredl2022-05-18
| |
* | fix(ui): set correct position on mouse click when 'winbar' is enabledFamiu Haque2022-05-18
|/
* feat(ui): add `'winbar'`Famiu Haque2022-05-18
| | | | | | | Adds support for a bar at the top of each window, enabled through the `'winbar'` option. Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
* refactor: replace char_u variables and functions with charDundar Goc2022-05-07
| | | | Work on https://github.com/neovim/neovim/issues/459