mirror of
https://github.com/stevearc/aerial.nvim
synced 2024-09-16 14:34:08 +02:00
Offload sticky buffer logic to stickybuf.nvim
This commit is contained in:
parent
ba8b030aaf
commit
404054ad54
2 changed files with 7 additions and 9 deletions
|
@ -243,3 +243,9 @@ hi AerialFunctionIcon guifg=#cb4b16 guibg=NONE guisp=NONE gui=NONE cterm=NONE
|
|||
" There's also this group for the cursor position
|
||||
hi link AerialLine QuickFixLine
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
**Q: I accidentally opened a file into the aerial window and it looks bad. How can I prevent this from happening?**
|
||||
|
||||
Try installing [stickybuf](https://github.com/stevearc/stickybuf.nvim). It was designed to prevent exactly this problem.
|
||||
|
|
|
@ -24,19 +24,11 @@ local function close_orphans()
|
|||
end
|
||||
|
||||
M.on_enter_buffer = function()
|
||||
local mybuf = vim.api.nvim_get_current_buf()
|
||||
if util.is_floating_win() then
|
||||
return
|
||||
end
|
||||
|
||||
-- If the user tried to open a non-aerial buffer inside the aerial window,
|
||||
-- close the window and re-open the buffer.
|
||||
mybuf = vim.api.nvim_get_current_buf()
|
||||
if vim.w.is_aerial_win and not util.is_aerial_buffer(mybuf) then
|
||||
vim.api.nvim_win_close(0, false)
|
||||
vim.api.nvim_set_current_buf(mybuf)
|
||||
end
|
||||
|
||||
local mybuf = vim.api.nvim_get_current_buf()
|
||||
if not util.is_aerial_buffer(mybuf) then
|
||||
if config.close_behavior == "close" then
|
||||
close_orphans()
|
||||
|
|
Loading…
Reference in a new issue