Skip to content

Commit 39e6fef

Browse files
authored
fix(#2415): highlight help header and mappings (#2669)
1 parent b278fc2 commit 39e6fef

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lua/nvim-tree/help.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,20 @@ local function compute()
119119
-- increase desc if lines are shorter than the header
120120
max_desc = math.max(max_desc, #head_lhs + #head_rhs1 - max_lhs)
121121

122-
-- header, not padded
123-
local hl = { { "NvimTreeRootFolder", 0, 0, #head_lhs } }
122+
-- header text, not padded
124123
local lines = {
125124
head_lhs .. string.rep(" ", max_desc + max_lhs - #head_lhs - #head_rhs1 + 2) .. head_rhs1,
126125
string.rep(" ", max_desc + max_lhs - #head_rhs2 + 2) .. head_rhs2,
127126
}
128127
local width = #lines[1]
129128

129+
-- header highlight, assume one character keys
130+
local hl = {
131+
{ "NvimTreeFolderName", 0, 0, #head_lhs },
132+
{ "NvimTreeFolderName", 0, width - 1, width },
133+
{ "NvimTreeFolderName", 1, width - 1, width },
134+
}
135+
130136
-- mappings, left padded 1
131137
local fmt = string.format(" %%-%ds %%-%ds", max_lhs, max_desc)
132138
for i, l in ipairs(mappings) do

0 commit comments

Comments
 (0)