mirror of
https://github.com/stevearc/aerial.nvim
synced 2024-09-16 14:34:08 +02:00
fix: aerial ignores diff windows (#299)
This commit is contained in:
parent
c2ed3b98b2
commit
c383f45ec0
2 changed files with 7 additions and 2 deletions
|
@ -82,10 +82,10 @@ M.on_enter_buffer = util.throttle(function()
|
|||
local config = require("aerial.config")
|
||||
local fold = require("aerial.fold")
|
||||
local window = require("aerial.window")
|
||||
backends.attach()
|
||||
if util.is_ignored_win() then
|
||||
return
|
||||
end
|
||||
backends.attach()
|
||||
|
||||
local mybuf = vim.api.nvim_get_current_buf()
|
||||
|
||||
|
|
|
@ -267,12 +267,17 @@ end
|
|||
---@return boolean
|
||||
---@return nil|string
|
||||
M.is_ignored_win = function(winid)
|
||||
winid = winid or 0
|
||||
if not winid or winid == 0 then
|
||||
winid = vim.api.nvim_get_current_win()
|
||||
end
|
||||
local bufnr = vim.api.nvim_win_get_buf(winid)
|
||||
local ignore_buf, message = M.is_ignored_buf(bufnr)
|
||||
if ignore_buf then
|
||||
return ignore_buf, message
|
||||
end
|
||||
if vim.wo[winid].diff then
|
||||
return true, "Viewing a diff"
|
||||
end
|
||||
local ignore = config.ignore
|
||||
if ignore.wintypes then
|
||||
local wintype = vim.fn.win_gettype(winid)
|
||||
|
|
Loading…
Reference in a new issue