Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lua/neo-tree/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -551,13 +551,14 @@ end
---@param bufnr number|nil The buffer number to open
M.open_file = function(state, path, open_cmd, bufnr)
open_cmd = open_cmd or "edit"
if open_cmd == "edit" or open_cmd == "e" then
local cmd_for_buf = { edit = "b", e = "b", split = "sb", sp = "sb" }
if open_cmd[cmd_for_buf] ~= nil then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be if cmd_for_buf[open_cmd] ....

It's the other way around.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I can see it! 😄

-- If the file is already open, switch to it.
bufnr = bufnr or M.find_buffer_by_name(path)
if bufnr <= 0 then
bufnr = nil
else
open_cmd = "b"
open_cmd = cmd_for_buf[open_cmd]
end
end

Expand Down