BUG: close_if_last_window
invalid command to swap to modified buffer
#1350
Labels
bug
Something isn't working
Did you check docs and existing issues?
Neovim Version (nvim -v)
NVIM v0.9.2
Operating System / Version
Windows 11 22H2
Describe the Bug
When the
close_if_last_window
option is enabled, the "swap to modified buffer" scheduled function ininit.lua
causes the errorE492: Not an editor command: ...
. This only happens for buffers of files on disk (not unnamed buffers), specifically on a Windows system. This does not occur on WSL for the same system.Possible root cause:
Looking at the traceback, it looks like this occurs because the
:b[uffer]
command is concatenating with an absolute Windows path (e.g., starting with a partition letter) resulting in an "unknown" command such as:bC:/...
(see line 310 below):neo-tree.nvim/lua/neo-tree/setup/init.lua
Lines 306 to 311 in cfe1920
Example
:b
test on Windows:nvim C:/foo.txt
:b C:\foo.txt
and:b C:/foo.txt
work as expected:bC:\foo.txt
and:bC:/foo.txt
causes the errorE492: Not an editor command: bC:...
Screenshots, Traceback
Steps to Reproduce
lazy
per README. Minimalinit.lua
provided below, but the following is the relevant plugin spec for neo-tree to create the behavior::Neotree filesystem reveal left
:q
and observe the errorExpected Behavior
The modified buffer is focused without causing an error.
Your Configuration
The text was updated successfully, but these errors were encountered: