From 93c8fe77cbfd3934c7599196e573136f75f6e9af Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 6 Jul 2022 12:34:24 +0100 Subject: 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 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 --- src/nvim/options.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/nvim/options.lua') diff --git a/src/nvim/options.lua b/src/nvim/options.lua index a0fbf8d9f0..addc08d560 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -1621,6 +1621,14 @@ return { varname='p_mousem', defaults={if_true="extend"} }, + { + full_name='mousescroll', + short_desc=N_("amount to scroll by when scrolling with a mouse"), + type='string', list='comma', scope={'global'}, + vi_def=true, + varname='p_mousescroll', + defaults={if_true="ver:3,hor:6"} + }, { full_name='mouseshape', abbreviation='mouses', short_desc=N_("shape of the mouse pointer in different modes"), -- cgit