aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2020-09-06 11:40:07 -0700
committerGitHub <noreply@github.com>2020-09-06 11:40:07 -0700
commitc1d395a6d664933ec7a644362721db115efef664 (patch)
treec3e68c81eac71a2a75a46f45422f0ddac70b38d6
parentd6b280799fb873dfc40b8012d40d0bb54bc9d588 (diff)
downloadrneovim-c1d395a6d664933ec7a644362721db115efef664.tar.gz
rneovim-c1d395a6d664933ec7a644362721db115efef664.tar.bz2
rneovim-c1d395a6d664933ec7a644362721db115efef664.zip
UI: forward 'mousefocus' option #12863
close #12849 ref eb4aab7173fa1733f77bb6d7117351b47ada6134
-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()