Skip to content

Commit 974bbd4

Browse files
authored
fix(popups): dont add spacing when the title is empty (#1488)
1 parent 29f7c21 commit 974bbd4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lua/neo-tree/ui/popups.lua

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ local log = require("neo-tree.log")
77
local M = {}
88

99
M.popup_options = function(title, min_width, override_options)
10+
if string.len(title) ~= 0 then
11+
title = " " .. title .. " "
12+
end
1013
min_width = min_width or 30
1114
local width = string.len(title) + 2
1215

1316
local nt = require("neo-tree")
1417
local popup_border_style = nt.config.popup_border_style
15-
local popup_border_text = NuiText(" " .. title .. " ", highlights.FLOAT_TITLE)
18+
local popup_border_text = NuiText(title, highlights.FLOAT_TITLE)
1619
local col = 0
1720
-- fix popup position when using multigrid
1821
local popup_last_col = vim.api.nvim_win_get_position(0)[2] + width + 2
@@ -49,7 +52,7 @@ M.popup_options = function(title, min_width, override_options)
4952

5053
if popup_border_style == "NC" then
5154
local blank = NuiText(" ", highlights.TITLE_BAR)
52-
popup_border_text = NuiText(" " .. title .. " ", highlights.TITLE_BAR)
55+
popup_border_text = NuiText(title, highlights.TITLE_BAR)
5356
popup_options.border = {
5457
style = { "", blank, "", "", " ", "", " ", "" },
5558
highlight = highlights.FLOAT_BORDER,

0 commit comments

Comments
 (0)