mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 19:06:31 +00:00
defaults: 'showcmd', 'belloff', 'ruler'
- Vim "unix default" of 'noshowcmd' is serving few users. And it's inconsistent. - 'ruler' and 'belloff=all' improve the out-of-the-box experience. - Continue to use 'noshowcmd' and 'noruler' by default in the functional tests to keep them fast. TODO: Add a "disable slow stuff" command or mapping to address the use-case of a very slow terminal connection.
This commit is contained in:
@@ -7,14 +7,10 @@ local ok, set_session, spawn = helpers.ok, helpers.set_session, helpers.spawn
|
||||
|
||||
local shada_file = 'test.shada'
|
||||
|
||||
--
|
||||
-- helpers.clear() uses "-i NONE", which is not useful for this test.
|
||||
--
|
||||
local function _clear()
|
||||
set_session(spawn({nvim_prog,
|
||||
'-u', 'NONE',
|
||||
'--cmd', 'set noswapfile undodir=. directory=. viewdir=. backupdir=.',
|
||||
'--embed'}))
|
||||
set_session(spawn({nvim_prog, '--embed', '-u', 'NONE', '--cmd',
|
||||
-- Need shada for these tests.
|
||||
'set noswapfile undodir=. directory=. viewdir=. backupdir=. belloff= noshowcmd noruler'}))
|
||||
end
|
||||
|
||||
describe(':oldfiles', function()
|
||||
@@ -63,7 +59,7 @@ describe(':browse oldfiles', function()
|
||||
_clear()
|
||||
execute('rshada! ' .. shada_file)
|
||||
|
||||
-- Ensure nvim is out of "Press ENTER..." screen
|
||||
-- Ensure nvim is out of "Press ENTER..." prompt.
|
||||
feed('<cr>')
|
||||
|
||||
-- Ensure v:oldfiles isn't busted. Since things happen so fast,
|
||||
|
@@ -20,9 +20,12 @@ local filter = global_helpers.filter
|
||||
local start_dir = lfs.currentdir()
|
||||
-- XXX: NVIM_PROG takes precedence, QuickBuild sets it.
|
||||
local nvim_prog = os.getenv('NVIM_PROG') or os.getenv('NVIM_PRG') or 'build/bin/nvim'
|
||||
-- Default settings for the test session.
|
||||
local nvim_set = 'set shortmess+=I background=light noswapfile noautoindent'
|
||||
..' laststatus=1 undodir=. directory=. viewdir=. backupdir=.'
|
||||
..' belloff= noshowcmd noruler'
|
||||
local nvim_argv = {nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N',
|
||||
'--cmd', 'set shortmess+=I background=light noswapfile noautoindent laststatus=1 undodir=. directory=. viewdir=. backupdir=.',
|
||||
'--embed'}
|
||||
'--cmd', nvim_set, '--embed'}
|
||||
|
||||
local mpack = require('mpack')
|
||||
|
||||
@@ -597,6 +600,7 @@ local M = {
|
||||
nvim = nvim,
|
||||
nvim_async = nvim_async,
|
||||
nvim_prog = nvim_prog,
|
||||
nvim_set = nvim_set,
|
||||
nvim_dir = nvim_dir,
|
||||
buffer = buffer,
|
||||
window = window,
|
||||
|
@@ -11,9 +11,7 @@ local neq = helpers.neq
|
||||
|
||||
local function init_session(...)
|
||||
local args = { helpers.nvim_prog, '-i', 'NONE', '--embed',
|
||||
'--cmd', 'set shortmess+=I background=light noswapfile noautoindent',
|
||||
'--cmd', 'set laststatus=1 undodir=. directory=. viewdir=. backupdir=.'
|
||||
}
|
||||
'--cmd', helpers.nvim_set }
|
||||
for _, v in ipairs({...}) do
|
||||
table.insert(args, v)
|
||||
end
|
||||
|
@@ -10,7 +10,7 @@ local function nvim_argv(shada_file)
|
||||
local rtp_value = ('\'%s/runtime\''):format(
|
||||
paths.test_source_path:gsub('\'', '\'\''))
|
||||
local nvim_args = {nvim_prog, '-u', 'NORC', '-i', shada_file or 'NONE', '-N',
|
||||
'--cmd', 'set shortmess+=I background=light noswapfile',
|
||||
'--cmd', 'set shortmess+=I background=light noswapfile belloff= noshowcmd noruler',
|
||||
'--cmd', 'let &runtimepath=' .. rtp_value,
|
||||
'--cmd', additional_cmd,
|
||||
'--embed'}
|
||||
@@ -23,7 +23,7 @@ end
|
||||
|
||||
local session = nil
|
||||
|
||||
local reset = function(...)
|
||||
local function reset(...)
|
||||
if session then
|
||||
session:close()
|
||||
end
|
||||
@@ -31,7 +31,7 @@ local reset = function(...)
|
||||
set_session(session)
|
||||
end
|
||||
|
||||
local set_additional_cmd = function(s)
|
||||
local function set_additional_cmd(s)
|
||||
additional_cmd = s
|
||||
end
|
||||
|
||||
|
@@ -12,7 +12,7 @@ describe('api', function()
|
||||
helpers.clear()
|
||||
os.remove(socket_name)
|
||||
screen = child_session.screen_setup(0, '["'..helpers.nvim_prog
|
||||
..'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile"]')
|
||||
..'", "-u", "NONE", "-i", "NONE", "--cmd", "'..helpers.nvim_set..'"]')
|
||||
end)
|
||||
after_each(function()
|
||||
os.remove(socket_name)
|
||||
@@ -28,7 +28,7 @@ describe('api', function()
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{5:[No Name] }|
|
||||
{4:~ }|
|
||||
]]..socket_name..[[ |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
@@ -43,7 +43,7 @@ describe('api', function()
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{5:[No Name] [+] }|
|
||||
{4:~ }|
|
||||
{3:-- INSERT --} |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
@@ -59,7 +59,7 @@ describe('api', function()
|
||||
[socket 1] this is more t{4: }|
|
||||
han 25 columns {4: }|
|
||||
[socket 2] input{1: } {4: }|
|
||||
{5:[No Name] [+] }|
|
||||
{4:~ }|
|
||||
{3:-- INSERT --} |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
|
@@ -13,7 +13,8 @@ describe('tui', function()
|
||||
|
||||
before_each(function()
|
||||
helpers.clear()
|
||||
screen = thelpers.screen_setup(0, '["'..helpers.nvim_prog..'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile"]')
|
||||
screen = thelpers.screen_setup(0, '["'..helpers.nvim_prog
|
||||
..'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile noshowcmd noruler"]')
|
||||
-- right now pasting can be really slow in the TUI, especially in ASAN.
|
||||
-- this will be fixed later but for now we require a high timeout.
|
||||
screen.timeout = 60000
|
||||
@@ -177,7 +178,8 @@ describe('tui with non-tty file descriptors', function()
|
||||
end)
|
||||
|
||||
it('can handle pipes as stdout and stderr', function()
|
||||
local screen = thelpers.screen_setup(0, '"'..helpers.nvim_prog..' -u NONE -i NONE --cmd \'set noswapfile\' --cmd \'normal iabc\' > /dev/null 2>&1 && cat testF && rm testF"')
|
||||
local screen = thelpers.screen_setup(0, '"'..helpers.nvim_prog
|
||||
..' -u NONE -i NONE --cmd \'set noswapfile noshowcmd noruler\' --cmd \'normal iabc\' > /dev/null 2>&1 && cat testF && rm testF"')
|
||||
feed(':w testF\n:q\n')
|
||||
screen:expect([[
|
||||
:w testF |
|
||||
@@ -196,7 +198,8 @@ describe('tui focus event handling', function()
|
||||
|
||||
before_each(function()
|
||||
helpers.clear()
|
||||
screen = thelpers.screen_setup(0, '["'..helpers.nvim_prog..'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile"]')
|
||||
screen = thelpers.screen_setup(0, '["'..helpers.nvim_prog
|
||||
..'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile noshowcmd noruler"]')
|
||||
execute('autocmd FocusGained * echo "gained"')
|
||||
execute('autocmd FocusLost * echo "lost"')
|
||||
end)
|
||||
@@ -313,7 +316,7 @@ describe("tui 't_Co' (terminal colors)", function()
|
||||
-- This is ugly because :term/termopen() forces TERM=xterm-256color.
|
||||
-- TODO: Revisit this after jobstart/termopen accept `env` dict.
|
||||
screen = thelpers.screen_setup(0, string.format(
|
||||
[=[['sh', '-c', 'LANG=C TERM=%s %s %s -u NONE -i NONE --cmd "silent set noswapfile"']]=],
|
||||
[=[['sh', '-c', 'LANG=C TERM=%s %s %s -u NONE -i NONE --cmd "silent set noswapfile noshowcmd noruler"']]=],
|
||||
term,
|
||||
(colorterm ~= nil and "COLORTERM="..colorterm or ""),
|
||||
helpers.nvim_prog))
|
||||
|
@@ -8,13 +8,13 @@ describe("shell command :!", function()
|
||||
before_each(function()
|
||||
session.clear()
|
||||
screen = child_session.screen_setup(0, '["'..session.nvim_prog..
|
||||
'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile"]')
|
||||
'", "-u", "NONE", "-i", "NONE", "--cmd", "'..session.nvim_set..'"]')
|
||||
screen:expect([[
|
||||
{1: } |
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{5:[No Name] }|
|
||||
{4:~ }|
|
||||
|
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
@@ -32,7 +32,7 @@ describe("shell command :!", function()
|
||||
screen:expect([[
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{5:[No Name] }|
|
||||
{4:~ }|
|
||||
:!printf foo; sleep 200 |
|
||||
|
|
||||
foo |
|
||||
|
@@ -9,7 +9,7 @@ local eval = helpers.eval
|
||||
describe('Initial screen', function()
|
||||
local screen
|
||||
local nvim_argv = {helpers.nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N',
|
||||
'--cmd', 'set shortmess+=I background=light noswapfile',
|
||||
'--cmd', 'set shortmess+=I background=light noswapfile belloff= noshowcmd noruler',
|
||||
'--embed'}
|
||||
|
||||
before_each(function()
|
||||
|
Reference in New Issue
Block a user