fix(status): Show code window active when no outline opened yet
This commit is contained in:
@@ -163,11 +163,16 @@ function M.show_status()
|
|||||||
end
|
end
|
||||||
|
|
||||||
---@type outline.StatusContext
|
---@type outline.StatusContext
|
||||||
local ctx = { priority = cfg.o.providers.priority }
|
local ctx = {
|
||||||
|
priority = cfg.o.providers.priority,
|
||||||
|
outline_open = is_open,
|
||||||
|
}
|
||||||
|
|
||||||
if vim.api.nvim_buf_is_valid(buf) then
|
if vim.api.nvim_buf_is_valid(buf) then
|
||||||
ctx.ft = vim.api.nvim_buf_get_option(buf, 'ft')
|
ctx.ft = vim.api.nvim_buf_get_option(buf, 'ft')
|
||||||
|
-- TODO: else?
|
||||||
end
|
end
|
||||||
|
|
||||||
ctx.filter = cfg.o.symbols.user_config_filter[ctx.ft]
|
ctx.filter = cfg.o.symbols.user_config_filter[ctx.ft]
|
||||||
ctx.default_filter = cfg.o.symbols.user_config_filter.default
|
ctx.default_filter = cfg.o.symbols.user_config_filter.default
|
||||||
|
|
||||||
@@ -178,13 +183,12 @@ function M.show_status()
|
|||||||
|
|
||||||
if p ~= nil then
|
if p ~= nil then
|
||||||
ctx.provider = p
|
ctx.provider = p
|
||||||
ctx.outline_open = false
|
-- Just show code window is active when the first outline in this tabpage
|
||||||
if is_open then
|
-- has not yet been opened.
|
||||||
ctx.outline_open = true
|
if not sidebar then
|
||||||
end
|
|
||||||
ctx.code_win_active = false
|
|
||||||
if require('outline.preview').has_code_win(win) then
|
|
||||||
ctx.code_win_active = true
|
ctx.code_win_active = true
|
||||||
|
else
|
||||||
|
ctx.code_win_active = require('outline.preview').has_code_win(win)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user