mirror of
https://github.com/stevearc/aerial.nvim
synced 2024-09-16 14:34:08 +02:00
fix: return cursor to source window when closing aerial (#241)
This commit is contained in:
parent
3d8360f010
commit
a2beef7cd6
1 changed files with 5 additions and 6 deletions
|
@ -213,7 +213,11 @@ end
|
|||
|
||||
M.close = function()
|
||||
if util.is_aerial_buffer() then
|
||||
local source_win = util.get_source_win(0)
|
||||
vim.api.nvim_win_close(0, false)
|
||||
if source_win then
|
||||
vim.api.nvim_set_current_win(source_win)
|
||||
end
|
||||
else
|
||||
local aer_win = util.get_aerial_win()
|
||||
if aer_win then
|
||||
|
@ -327,12 +331,7 @@ M.focus = function()
|
|||
end
|
||||
|
||||
M.toggle = function(focus, direction)
|
||||
if util.is_aerial_buffer() then
|
||||
vim.api.nvim_win_close(0, false)
|
||||
return false
|
||||
end
|
||||
|
||||
if M.is_open() then
|
||||
if util.is_aerial_buffer() or M.is_open() then
|
||||
M.close()
|
||||
return false
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue