aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/options.txt1
-rw-r--r--runtime/doc/ui.txt1
-rw-r--r--src/nvim/option_defs.h1
-rw-r--r--src/nvim/options.lua3
-rw-r--r--test/functional/ui/options_spec.lua7
5 files changed, 11 insertions, 2 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 00fa947f6d..190d6f9229 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -4022,7 +4022,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'mousefocus'* *'mousef'* *'nomousefocus'* *'nomousef'*
'mousefocus' 'mousef' boolean (default off)
global
- {only works in the GUI}
The window that the mouse pointer is on is automatically activated.
When changing the window layout or window focus in another way, the
mouse pointer is moved to the window with keyboard focus. Off is the
diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt
index 990f58b291..e5c6b9b1b7 100644
--- a/runtime/doc/ui.txt
+++ b/runtime/doc/ui.txt
@@ -185,6 +185,7 @@ the editor.
'guifont'
'guifontwide'
'linespace'
+ 'mousefocus'
'pumblend'
'showtabline'
'termguicolors'
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h
index eb8f051b9c..02fa7ac216 100644
--- a/src/nvim/option_defs.h
+++ b/src/nvim/option_defs.h
@@ -512,6 +512,7 @@ EXTERN long p_mle; // 'modelineexpr'
EXTERN long p_mls; // 'modelines'
EXTERN char_u *p_mouse; // 'mouse'
EXTERN char_u *p_mousem; // 'mousemodel'
+EXTERN long p_mousef; // 'mousefocus'
EXTERN long p_mouset; // 'mousetime'
EXTERN int p_more; // 'more'
EXTERN char_u *p_opfunc; // 'operatorfunc'
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
index 79fea1f628..f1221a52a2 100644
--- a/src/nvim/options.lua
+++ b/src/nvim/options.lua
@@ -1588,7 +1588,8 @@ return {
full_name='mousefocus', abbreviation='mousef',
type='bool', scope={'global'},
vi_def=true,
- enable_if=false,
+ redraw={'ui_option'},
+ varname='p_mousef',
defaults={if_true={vi=false}}
},
{
diff --git a/test/functional/ui/options_spec.lua b/test/functional/ui/options_spec.lua
index 1593f04f41..2f113f6ac6 100644
--- a/test/functional/ui/options_spec.lua
+++ b/test/functional/ui/options_spec.lua
@@ -17,6 +17,7 @@ describe('UI receives option updates', function()
guifontwide='',
linespace=0,
pumblend=0,
+ mousefocus=false,
showtabline=1,
termguicolors=false,
ttimeout=true,
@@ -109,6 +110,12 @@ describe('UI receives option updates', function()
eq(expected, screen.options)
end)
+ command("set mousefocus")
+ expected.mousefocus = true
+ screen:expect(function()
+ eq(expected, screen.options)
+ end)
+
command("set nottimeout")
expected.ttimeout = false
screen:expect(function()