fix(#2003): obey user split command for modified buffers when hidden not set (#2008)

This commit is contained in:
Alexander Courtis 2023-02-20 10:04:55 +11:00 committed by GitHub
parent bcb969c869
commit 04f99f14b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -230,7 +230,9 @@ local function open_in_new_window(filename, mode, win_ids)
-- modified, and create new split if it is.
local target_bufid = vim.api.nvim_win_get_buf(target_winid)
if vim.api.nvim_buf_get_option(target_bufid, "modified") then
mode = "vsplit"
if not mode:match "split$" then
mode = "vsplit"
end
end
end