aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/options.txt2
-rw-r--r--runtime/doc/ui.txt1
-rw-r--r--src/nvim/option_defs.h1
-rw-r--r--src/nvim/options.lua5
-rw-r--r--test/functional/ui/options_spec.lua13
5 files changed, 19 insertions, 3 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 067aad1f93..b3139f3298 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -3676,7 +3676,7 @@ A jump table for the options with a short description can be found at |Q_op|.
< Minimum value is 2, maximum value is 1000.
*'linespace'* *'lsp'*
-'linespace' 'lsp' number (default 0, 1 for Win32 GUI)
+'linespace' 'lsp' number (default 0)
global
{only in the GUI}
Number of pixel lines inserted between characters. Useful if the font
diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt
index e1c5523202..1b3c10b71e 100644
--- a/runtime/doc/ui.txt
+++ b/runtime/doc/ui.txt
@@ -90,6 +90,7 @@ Global Events *ui-global*
'guifont'
'guifontset'
'guifontwide'
+ 'linespace'
'showtabline'
'termguicolors'
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h
index 864723a10c..b7fb40a7c1 100644
--- a/src/nvim/option_defs.h
+++ b/src/nvim/option_defs.h
@@ -481,6 +481,7 @@ EXTERN char_u *p_langmap; // 'langmap'
EXTERN int p_lnr; // 'langnoremap'
EXTERN int p_lrm; // 'langremap'
EXTERN char_u *p_lm; // 'langmenu'
+EXTERN long *p_linespace; // 'linespace'
EXTERN char_u *p_lispwords; // 'lispwords'
EXTERN long p_ls; // 'laststatus'
EXTERN long p_stal; // 'showtabline'
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
index 35baaf948f..eee0c2f671 100644
--- a/src/nvim/options.lua
+++ b/src/nvim/options.lua
@@ -1399,8 +1399,9 @@ return {
full_name='linespace', abbreviation='lsp',
type='number', scope={'global'},
vi_def=true,
- redraw={'everything'},
- enable_if=false,
+ redraw={'everything', 'ui_option'},
+ varname='p_linespace',
+ defaults={if_true={vi=0}}
},
{
full_name='lisp',
diff --git a/test/functional/ui/options_spec.lua b/test/functional/ui/options_spec.lua
index 14f40b3ec1..bc72ca71aa 100644
--- a/test/functional/ui/options_spec.lua
+++ b/test/functional/ui/options_spec.lua
@@ -24,6 +24,7 @@ describe('ui receives option updates', function()
guifont='',
guifontset='',
guifontwide='',
+ linespace=0,
showtabline=1,
termguicolors=false,
}
@@ -58,6 +59,18 @@ describe('ui receives option updates', function()
eq(changed, screen.options)
end)
+ command("set linespace=13")
+ changed.linespace = 13
+ screen:expect(function()
+ eq(changed, screen.options)
+ end)
+
+ command("set linespace=-11")
+ changed.linespace = -11
+ screen:expect(function()
+ eq(changed, screen.options)
+ end)
+
command("set all&")
screen:expect(function()
eq(defaults, screen.options)