mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
terminal: absolute CWD in term:// URI #11289
This makes it possible to restore the working directory of :terminal buffers when reading those buffers from a session file. Fixes #11288 Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
This commit is contained in:
committed by
Justin M. Keyes
parent
451af7f087
commit
c6ff23d7a0
@@ -5,9 +5,12 @@ local curbufmeths = helpers.curbufmeths
|
||||
local curwinmeths = helpers.curwinmeths
|
||||
local nvim_dir = helpers.nvim_dir
|
||||
local command = helpers.command
|
||||
local funcs = helpers.funcs
|
||||
local meths = helpers.meths
|
||||
local clear = helpers.clear
|
||||
local eq = helpers.eq
|
||||
local matches = helpers.matches
|
||||
local pesc = helpers.pesc
|
||||
|
||||
describe(':edit term://*', function()
|
||||
local get_screen = function(columns, lines)
|
||||
@@ -28,7 +31,8 @@ describe(':edit term://*', function()
|
||||
command('edit term://')
|
||||
local termopen_runs = meths.get_var('termopen_runs')
|
||||
eq(1, #termopen_runs)
|
||||
eq(termopen_runs[1], termopen_runs[1]:match('^term://.//%d+:$'))
|
||||
local cwd = funcs.fnamemodify('.', ':p:~'):gsub([[[\/]*$]], '')
|
||||
matches('^term://'..pesc(cwd)..'//%d+:$', termopen_runs[1])
|
||||
end)
|
||||
|
||||
it("runs TermOpen early enough to set buffer-local 'scrollback'", function()
|
||||
|
||||
Reference in New Issue
Block a user