mirror of
https://github.com/neovim/neovim.git
synced 2026-08-01 13:19:20 +00:00
feat(:restart): v:startreason #40186
Problem:
It's clumsy for scripts to handle a "restart", without custom mappings or
global vars.
Solution:
Introduce `v:startreason`
(cherry picked from commit ae426ee465)
This commit is contained in:
committed by
Olivia Kinnear
parent
a4985ac902
commit
611b4f8237
@@ -48,3 +48,11 @@ describe('v:argf', function()
|
||||
eq({ abs1, abs2, abs3 }, n.eval('v:argf'))
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('v:startreason', function()
|
||||
it('is read-only and starts as "normal"', function()
|
||||
n.clear { args = { '--cmd', 'let g:early_startreason = v:startreason' } }
|
||||
eq('normal', eval('g:early_startreason'))
|
||||
t.matches('E46', t.pcall_err(command, "let v:startreason = 'restart'"))
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user