Open Bekaboo opened 7 months ago
local tmp = '/tmp' local data = tmp .. '/' .. (vim.env.NVIM_APPNAME or 'nvim') local package_root = data .. '/site' local clone_root = package_root .. '/pack/packages/start' local clone_info = { { path = clone_root .. '/cmp-cmdline', url = 'https://github.com/hrsh7th/cmp-cmdline.git', }, { path = clone_root .. '/nvim-cmp', url = 'https://github.com/hrsh7th/nvim-cmp.git', }, } vim.fn.mkdir(clone_root, 'p') vim.opt.pp:prepend(package_root) vim.opt.rtp:prepend(package_root) vim.opt.mousemoveevent = true for _, info in ipairs(clone_info) do if not vim.loop.fs_stat(info.path) then vim.notify('cloning ' .. info.url, vim.log.levels.INFO) vim.fn.system({ 'git', 'clone', info.url, info.path }) end end local cmp = require('cmp') cmp.setup({}) cmp.setup.cmdline(':', { enabled = true, sources = { { name = 'cmdline', option = { ignore_cmds = {}, }, }, }, })
Local cwd is wrong after restoring session from file if using cmp autocompletion in cmdline.
mkdir -p ~/test/a/
nvim -u ~/cmp-repro.lua
:tcd ~/test/
:lcd sub/
:mks! ~/session
nvim -u ~/cmp-repro.lua -S ~/session
:verbose pwd
[window] /home/<username>/test
[window] /home/<username>/test/a
Local working directory should be ~/test/a
~/test/a
Local working directory is ~/test
~/test
No response
Have encountered the same problem. Did you find out the root of the problem or solution?
FAQ
Announcement
Minimal reproducible full config
Description
Local cwd is wrong after restoring session from file if using cmp autocompletion in cmdline.
Steps to reproduce
mkdir -p ~/test/a/
nvim -u ~/cmp-repro.lua
:tcd ~/test/
:lcd sub/
:mks! ~/session
nvim -u ~/cmp-repro.lua -S ~/session
:verbose pwd
-->[window] /home/<username>/test
, should be[window] /home/<username>/test/a
Expected behavior
Local working directory should be
~/test/a
Actual behavior
Local working directory is
~/test
Additional context
No response