diff options
author | Jay <jaysandhu1993@gmail.com> | 2022-07-06 12:34:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-06 19:34:24 +0800 |
commit | 93c8fe77cbfd3934c7599196e573136f75f6e9af (patch) | |
tree | abbe636e1e8a2bfaf26fa494bf2fc02fe593e688 /src/nvim/option_defs.h | |
parent | 9ced05413474a7c8b8a8b2f36a27db29a37dfaf6 (diff) | |
download | rneovim-93c8fe77cbfd3934c7599196e573136f75f6e9af.tar.gz rneovim-93c8fe77cbfd3934c7599196e573136f75f6e9af.tar.bz2 rneovim-93c8fe77cbfd3934c7599196e573136f75f6e9af.zip |
feat: add 'mousescroll' option (#12355)
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
Diffstat (limited to 'src/nvim/option_defs.h')
-rw-r--r-- | src/nvim/option_defs.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index 531527ea3c..237288fbad 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -153,6 +153,11 @@ #define MOUSE_NONE ' ' // don't use Visual selection #define MOUSE_NONEF 'x' // forced modeless selection +// default vertical and horizontal mouse scroll values. +// Note: This should be in sync with the default mousescroll option. +#define MOUSESCROLL_VERT_DFLT 3 +#define MOUSESCROLL_HOR_DFLT 6 + #define COCU_ALL "nvic" // flags for 'concealcursor' /// characters for p_shm option: @@ -528,6 +533,9 @@ EXTERN long p_mls; // 'modelines' EXTERN char_u *p_mouse; // 'mouse' EXTERN char_u *p_mousem; // 'mousemodel' EXTERN int p_mousef; // 'mousefocus' +EXTERN char_u *p_mousescroll; // 'mousescroll' +EXTERN long p_mousescroll_vert INIT(= MOUSESCROLL_VERT_DFLT); +EXTERN long p_mousescroll_hor INIT(= MOUSESCROLL_HOR_DFLT); EXTERN long p_mouset; // 'mousetime' EXTERN int p_more; // 'more' EXTERN char_u *p_opfunc; // 'operatorfunc' |