From bdc94c53871bf16a4043ab563aa87d4677ab4907 Mon Sep 17 00:00:00 2001 From: Linus Boehm Date: Sat, 23 Mar 2024 23:10:54 -0400 Subject: [PATCH] feat: option to enable earial in diff windows (#355) resolves #354 Co-authored-by: Linus Boehm --- lua/aerial/config.lua | 3 +++ lua/aerial/util.lua | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/aerial/config.lua b/lua/aerial/config.lua index 003b7e3..8635c62 100644 --- a/lua/aerial/config.lua +++ b/lua/aerial/config.lua @@ -146,6 +146,9 @@ local default_options = { -- Ignore unlisted buffers. See :help buflisted unlisted_buffers = false, + -- Ignore diff windows (setting to false will allow aerial in diff windows) + diff_windows = true, + -- List of filetypes to ignore. filetypes = {}, diff --git a/lua/aerial/util.lua b/lua/aerial/util.lua index 6f5ca52..14af9e2 100644 --- a/lua/aerial/util.lua +++ b/lua/aerial/util.lua @@ -275,10 +275,10 @@ M.is_ignored_win = function(winid) if ignore_buf then return ignore_buf, message end - if vim.wo[winid].diff then + local ignore = config.ignore + if ignore.diff_windows and 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) if ignore.wintypes == "special" and wintype ~= "" then