Honor 'hidden' setting when deciding whether to split window

This commit is contained in:
Joel D. Elkins 2021-01-16 15:31:31 -06:00
parent 787cef2a1d
commit b0780ddc91
No known key found for this signature in database
GPG Key ID: 133589DC38921AE2

View File

@ -207,7 +207,7 @@ function M.open_file(mode, filename)
if not found and (mode == 'edit' or mode == 'preview') then
if target_bufnr then
if api.nvim_buf_get_option(target_bufnr, 'modified') then
if not vim.o.hidden and api.nvim_buf_get_option(target_bufnr, 'modified') then
ecmd = string.format('%dwindo %s', target_winnr, splitcmd)
end
else