feat: fix q on close last window (#31)
* fix(plugin): allow command chaining with bar separator Problem: :Pending|only failed because the command definition lacked the bar attribute, causing | to be consumed as an argument. Solution: Add bar = true to nvim_create_user_command so | is treated as a command separator, matching fugitive's :Git behavior. * fix: last window
This commit is contained in:
parent
4f4048228e
commit
d878b9346e
1 changed files with 8 additions and 1 deletions
|
|
@ -42,7 +42,14 @@ function M.clear_winid()
|
|||
end
|
||||
|
||||
function M.close()
|
||||
if task_winid and vim.api.nvim_win_is_valid(task_winid) then
|
||||
if not task_winid or not vim.api.nvim_win_is_valid(task_winid) then
|
||||
task_winid = nil
|
||||
return
|
||||
end
|
||||
local wins = vim.api.nvim_list_wins()
|
||||
if #wins == 1 then
|
||||
vim.cmd.enew()
|
||||
else
|
||||
vim.api.nvim_win_close(task_winid, false)
|
||||
end
|
||||
task_winid = nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue