Skip to content

Commit e6a4001

Browse files
committed
fix(staging): highlight for double-width chars (#27)
1 parent 6a93610 commit e6a4001

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/tinygit/commands/stage/telescope.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ local function newFinder(hunks)
5050
local iconWidth = vim.api.nvim_strwidth(conf.stagedIndicator)
5151
local status = h.alreadyStaged and conf.stagedIndicator or (" "):rep(iconWidth)
5252
status = status .. " " -- padding
53+
local iconHlWidth = #status -- needed for double-width chars, see #27
5354

5455
local out = status .. name .. location .. added .. del
5556
local statPos = #status + #name + #location
5657
local hlGroups = require("tinygit.config").config.appearance.hlGroups
5758
local highlights = {
58-
{ { 0, iconWidth }, "Keyword" }, -- icon for stage status
59+
{ { 0, iconHlWidth }, "Keyword" }, -- icon for stage status
5960
{ { #status + #name, statPos }, "Comment" }, -- lnum
6061
{ { statPos, statPos + #added }, hlGroups.addedText }, -- added
6162
{ { statPos + #added + 1, statPos + #added + #del }, hlGroups.removedText }, -- removed

0 commit comments

Comments
 (0)