aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/options.txt2
-rw-r--r--runtime/doc/vim_diff.txt1
-rw-r--r--src/nvim/option.c10
-rw-r--r--src/nvim/options.lua4
-rw-r--r--test/functional/helpers.lua2
-rw-r--r--test/functional/ui/screen_basic_spec.lua45
6 files changed, 54 insertions, 10 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index e4719c3065..f28e5b9515 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -4052,7 +4052,7 @@ A jump table for the options with a short description can be found at |Q_op|.
that works for you to avoid mappings to break.
*'laststatus'* *'ls'*
-'laststatus' 'ls' number (default 1)
+'laststatus' 'ls' number (default 2)
global
The value of this option influences when the last window will have a
status line:
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 2edc10486c..8f88906e38 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -39,6 +39,7 @@ these differences.
- 'hlsearch' is set by default
- 'incsearch' is set by default
- 'langnoremap' is set by default
+- 'laststatus' defaults to 2 (statusline is always shown)
- 'listchars' defaults to "tab:> ,trail:-,nbsp:+"
- 'mouse' defaults to "a"
- 'nocompatible' is always set
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 2d6e2af89e..38682f3142 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -454,6 +454,9 @@ void set_init_1(void)
/* Set all options to their Vim default */
set_options_default(OPT_FREE);
+ // set 'laststatus'
+ last_status(false);
+
/* Must be before option_expand(), because that one needs vim_isIDc() */
didset_options();
@@ -3662,10 +3665,9 @@ set_num_option (
p_wmw = p_wiw;
}
win_setminheight();
- }
- /* (re)set last window status line */
- else if (pp == &p_ls) {
- last_status(FALSE);
+ } else if (pp == &p_ls) {
+ /* (re)set last window status line */
+ last_status(false);
}
/* (re)set tab page line */
else if (pp == &p_stal) {
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
index 6506c6a9b5..89d49028ae 100644
--- a/src/nvim/options.lua
+++ b/src/nvim/options.lua
@@ -1360,10 +1360,10 @@ return {
{
full_name='laststatus', abbreviation='ls',
type='number', scope={'global'},
- vi_def=true,
+ vim=true,
redraw={'all_windows'},
varname='p_ls',
- defaults={if_true={vi=1}}
+ defaults={if_true={vi=1,vim=2}}
},
{
full_name='lazyredraw', abbreviation='lz',
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 1159707282..799b57494b 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -7,7 +7,7 @@ local Session = require('nvim.session')
local nvim_prog = os.getenv('NVIM_PROG') or 'build/bin/nvim'
local nvim_argv = {nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N',
- '--cmd', 'set shortmess+=I background=light noswapfile noautoindent',
+ '--cmd', 'set shortmess+=I background=light noswapfile noautoindent laststatus=1',
'--embed'}
-- Formulate a path to the directory containing nvim. We use this to
diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua
index 421c167300..7ba82c8b7b 100644
--- a/test/functional/ui/screen_basic_spec.lua
+++ b/test/functional/ui/screen_basic_spec.lua
@@ -1,8 +1,50 @@
local helpers = require('test.functional.helpers')
local Screen = require('test.functional.ui.screen')
-local clear, feed, execute = helpers.clear, helpers.feed, helpers.execute
+local spawn, set_session, clear = helpers.spawn, helpers.set_session, helpers.clear
+local feed, execute = helpers.feed, helpers.execute
local insert, wait = helpers.insert, helpers.wait
+describe('Initial screen', function()
+ local screen
+ local nvim_argv = {helpers.nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N',
+ '--cmd', 'set shortmess+=I background=light noswapfile',
+ '--embed'}
+
+ before_each(function()
+ if session then
+ session:exit(0)
+ end
+ local screen_nvim = spawn(nvim_argv)
+ set_session(screen_nvim)
+ screen = Screen.new()
+ screen:attach()
+ screen:set_default_attr_ignore( {{bold=true, foreground=255}} )
+ end)
+
+ after_each(function()
+ screen:detach()
+ end)
+
+ it('is the default initial screen', function()
+ screen:expect([[
+ ^ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ [No Name] |
+ |
+ ]])
+ end)
+end)
+
describe('Screen', function()
local screen
@@ -102,7 +144,6 @@ describe('Screen', function()
end)
end)
-
describe('window', function()
describe('split', function()
it('horizontal', function()