parent
9d77a07686
commit
f0a7e3fc9a
|
@ -5049,7 +5049,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||
security reasons.
|
||||
|
||||
*'shadafile'* *'sdf'*
|
||||
'shadafile' 'vif' string (default: "")
|
||||
'shadafile' 'sdf' string (default: "")
|
||||
global
|
||||
When non-empty, overrides the file name used for |shada| (viminfo).
|
||||
When equal to "NONE" no shada file will be read or written.
|
||||
|
|
|
@ -1081,15 +1081,16 @@ even if other entries (with known name/type/etc) are merged. |shada-merging|
|
|||
|
||||
SHADA FILE NAME *shada-file-name*
|
||||
|
||||
- The default name of the ShaDa file is "$XDG_DATA_HOME/nvim/shada/main.shada"
|
||||
for Unix. Default for $XDG_DATA_HOME is ~/.local/share. |base-directories|
|
||||
- The 'n' flag in the 'shada' option can be used to specify another ShaDa
|
||||
file name |'shada'|.
|
||||
- The "-i" Vim argument can be used to set another file name, |-i|. When the
|
||||
file name given is "NONE" (all uppercase), no ShaDa file is ever read or
|
||||
written. Also not for the commands below!
|
||||
- The 'viminfofile' option can be used like the "-i" argument. In fact, the
|
||||
value form the "-i" argument is stored in the 'viminfofile' option.
|
||||
- Default name of the |shada| file is:
|
||||
Unix: "$XDG_DATA_HOME/nvim/shada/main.shada"
|
||||
Windows: "$XDG_DATA_HOME/nvim-data/shada/main.shada"
|
||||
See also |base-directories|.
|
||||
- To choose a different file name you can use:
|
||||
- The "n" flag in the 'shada' option.
|
||||
- The |-i| startup argument. "NONE" means no shada file is ever read or
|
||||
written. Also not for the commands below!
|
||||
- The 'shadafile' option. The value from the "-i" argument (if any) is
|
||||
stored in the 'shadafile' option.
|
||||
- For the commands below, another file name can be given, overriding the
|
||||
default and the name given with 'shada' or "-i" (unless it's NONE).
|
||||
|
||||
|
|
|
@ -351,12 +351,13 @@ end
|
|||
|
||||
-- Starts a new global Nvim session.
|
||||
-- Parameters are interpreted as startup args, OR a map with these keys:
|
||||
-- args: Merged with the default `nvim_argv` set.
|
||||
-- args: Appended to the default `nvim_argv` set.
|
||||
-- env : Defines the environment of the new session.
|
||||
-- headless: Append --headless arg.
|
||||
--
|
||||
-- Example:
|
||||
-- clear('-e')
|
||||
-- clear({args={'-e'}, env={TERM=term}})
|
||||
-- clear{args={'-e'}, env={TERM=term}}
|
||||
local function clear(...)
|
||||
local args = {unpack(nvim_argv)}
|
||||
local new_args
|
||||
|
|
|
@ -15,6 +15,9 @@ local neq = helpers.neq
|
|||
local mkdir = helpers.mkdir
|
||||
local rmdir = helpers.rmdir
|
||||
local alter_slashes = helpers.alter_slashes
|
||||
local spawn = helpers.spawn
|
||||
local nvim_prog = helpers.nvim_prog
|
||||
local set_session = helpers.set_session
|
||||
|
||||
describe('startup defaults', function()
|
||||
describe(':filetype', function()
|
||||
|
@ -160,20 +163,43 @@ describe('startup defaults', function()
|
|||
end)
|
||||
end)
|
||||
|
||||
describe("'packpath'", function()
|
||||
it('defaults to &runtimepath', function()
|
||||
eq(meths.get_option('runtimepath'), meths.get_option('packpath'))
|
||||
end)
|
||||
it("'shadafile' ('viminfofile')", function()
|
||||
-- Cannot use clear() because we do not want "-i NONE".
|
||||
local function clear_use_default_shada()
|
||||
set_session(spawn({nvim_prog, '-u', 'NONE', '--embed', '--headless'},
|
||||
false,
|
||||
{XDG_DATA_HOME='Xtest-userdata',
|
||||
XDG_CONFIG_HOME='Xtest-userconfig'}))
|
||||
end
|
||||
clear_use_default_shada()
|
||||
-- Default 'shadafile' is empty.
|
||||
-- This means use the default location. :help shada-file-name
|
||||
eq('', meths.get_option('shadafile'))
|
||||
eq('', meths.get_option('viminfofile'))
|
||||
-- Check that shada data (such as v:oldfiles) is saved/restored.
|
||||
command('edit foo')
|
||||
command('write')
|
||||
local f = eval('fnamemodify(@%,":p")')
|
||||
assert(string.len(f) > 3)
|
||||
command('qall')
|
||||
clear_use_default_shada()
|
||||
eq({ f }, eval('v:oldfiles'))
|
||||
end)
|
||||
|
||||
it('does not follow modifications to runtimepath', function()
|
||||
meths.command('set runtimepath+=foo')
|
||||
neq(meths.get_option('runtimepath'), meths.get_option('packpath'))
|
||||
meths.command('set packpath+=foo')
|
||||
eq(meths.get_option('runtimepath'), meths.get_option('packpath'))
|
||||
end)
|
||||
it("'packpath'", function()
|
||||
clear()
|
||||
-- Defaults to &runtimepath.
|
||||
eq(meths.get_option('runtimepath'), meths.get_option('packpath'))
|
||||
|
||||
-- Does not follow modifications to runtimepath.
|
||||
meths.command('set runtimepath+=foo')
|
||||
neq(meths.get_option('runtimepath'), meths.get_option('packpath'))
|
||||
meths.command('set packpath+=foo')
|
||||
eq(meths.get_option('runtimepath'), meths.get_option('packpath'))
|
||||
end)
|
||||
|
||||
it('v:progpath is set to the absolute path', function()
|
||||
clear()
|
||||
eq(eval("fnamemodify(v:progpath, ':p')"), eval('v:progpath'))
|
||||
end)
|
||||
|
||||
|
|
Loading…
Reference in New Issue