commit dacd34364ff3af98bc2d357c43e3ce06638e2ce9
parent f96f8566b5f7997266264ba94a22844d9bc22699
Author: Jaehoon Hwang <jaehoonhwang@users.noreply.github.com>
Date: Mon, 9 Oct 2023 01:48:24 -0700
feat(ui-ext): make 'mousehide' into proper ui_option (#25532)
Diffstat:
4 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt
@@ -211,6 +211,7 @@ the editor.
- 'guifontwide'
- 'linespace'
- 'mousefocus'
+ - 'mousehide'
- 'mousemoveevent'
- 'pumblend'
- 'showtabline'
diff --git a/src/nvim/option_vars.h b/src/nvim/option_vars.h
@@ -571,6 +571,7 @@ EXTERN char *p_mouse; ///< 'mouse'
EXTERN char *p_mousem; ///< 'mousemodel'
EXTERN int p_mousemev; ///< 'mousemoveevent'
EXTERN int p_mousef; ///< 'mousefocus'
+EXTERN int p_mh; ///< 'mousehide'
EXTERN char *p_mousescroll; ///< 'mousescroll'
EXTERN OptInt p_mousescroll_vert INIT(= MOUSESCROLL_VERT_DFLT);
EXTERN OptInt p_mousescroll_hor INIT(= MOUSESCROLL_HOR_DFLT);
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
@@ -5452,9 +5452,11 @@ return {
]=],
enable_if = false,
full_name = 'mousehide',
+ redraw = { 'ui_option' },
scope = { 'global' },
short_desc = N_('hide mouse pointer while typing'),
type = 'bool',
+ varname = 'p_mh',
},
{
abbreviation = 'mousem',
diff --git a/test/functional/ui/options_spec.lua b/test/functional/ui/options_spec.lua
@@ -19,6 +19,7 @@ describe('UI receives option updates', function()
linespace=0,
pumblend=0,
mousefocus=false,
+ mousehide=true,
mousemoveevent=false,
showtabline=1,
termguicolors=false,
@@ -133,6 +134,12 @@ describe('UI receives option updates', function()
eq(expected, screen.options)
end)
+ command("set nomousehide")
+ expected.mousehide = false
+ screen:expect(function()
+ eq(expected, screen.options)
+ end)
+
command("set mousemoveevent")
expected.mousemoveevent = true
screen:expect(function()