Skip to content

Commit

Permalink
feat: expose window-local options in config (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Oct 28, 2022
1 parent 6b1e97e commit 1eb6d23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/aerial/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ local default_options = {
width = nil,
min_width = 10,

-- key-value pairs of window-local options for aerial window (e.g. winhl)
win_opts = {},

-- Determines the default direction to open the aerial window. The 'prefer'
-- options will open the window in the other direction *if* there is a
-- different buffer in the way of the preferred direction
Expand Down
3 changes: 3 additions & 0 deletions lua/aerial/window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ local function setup_aerial_win(src_winid, aer_winid, aer_bufnr)
vim.api.nvim_win_set_option(aer_winid, "relativenumber", false)
vim.api.nvim_win_set_option(aer_winid, "wrap", false)
vim.api.nvim_win_set_option(aer_winid, "spell", false)
for k, v in pairs(config.layout.win_opts) do
vim.api.nvim_win_set_option(aer_winid, k, v)
end
vim.api.nvim_win_set_var(aer_winid, "is_aerial_win", true)

vim.api.nvim_win_set_var(aer_winid, "source_win", src_winid)
Expand Down

0 comments on commit 1eb6d23

Please sign in to comment.