Unexpected reset of arglist when opening file from LF
mroavi opened this issue · comments
Issue Description:
Upon opening a file from LF, the arglist unexpectedly resets to only contain the opened file's name, disregarding any previous entries.
Steps to Reproduce:
- Create two test files,
one.md
andtwo.md
, using the command:
touch one.md two.md
- Open
one.md
with Neovim:
nvim one.md
-
Within Neovim, run the command
:arg
which outputs[one.md]
. -
Open LF using the
:Lf
command. -
With LF open, highlight
two.md
and pressenter
to open it. -
Now run
:arg
command again. This outputs[/home/mroavi/lf-bug/two.md]
, meaning the arglist has been reset to contain onlytwo.md
.
Problem:
This behavior of resetting the arglist to contain only the newly opened file from LF becomes problematic for users who rely on the arglist for various purposes. Ideally, the arglist should retain its previous entries and add any new file opened from LF, rather than completely resetting.
This bug was introduced in ffcacf5
All you have to do is change your default command from drop
to argedit
.
I added a keybinding for it in the latest commit. It is <C-g>
.
Do note that that I was able to get both of the filenames in the argument list by using the function vim.fn.argv()
.
Editing to say that it should now work just fine with :arg
.