Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Floating window #101

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lua/symbols-outline/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ M.defaults = {
highlight_hovered_item = true,
show_guides = true,
position = 'right',
floating = {
enabled = false,
width = 30,
height = 15,
row = 0.5,
col = 0.5,
},
border = 'single',
relative_width = true,
width = 25,
Expand Down
12 changes: 12 additions & 0 deletions lua/symbols-outline/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ function M.setup_view()
vim.api.nvim_buf_set_option(bufnr, "filetype", "Outline")
vim.api.nvim_buf_set_option(bufnr, "modifiable", false)

if config.options.floating.enabled == true then
local opts = {
height = config.options.floating.height,
width = config.options.floating.width,
row = config.options.floating.row,
col = config.options.floating.col,
border = "single",
relative = "editor",
}
vim.api.nvim_win_set_config(winnr, opts)
end

if config.options.show_numbers or config.options.show_relative_numbers then
vim.api.nvim_win_set_option(winnr, "nu", true)
end
Expand Down