Skip to content

Commit b47d210

Browse files
committed
Improve Neogit highlights
These changes reduce the shifting of colors that happens as one navigates hunks with the cursor on a `NeogitStatus` buffer. It reduces accessibility a tiny bit (by not showing a cursor line highlight inside hunks) but makes the theme look less broken and makes it easier to follow what's going on. It also fixes the `NeogitWinSeparator` highlight, which for some reason does not use `WinSeparator`.
1 parent 7de58b7 commit b47d210

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

lua/vscode/theme.lua

+21-14
Original file line numberDiff line numberDiff line change
@@ -649,22 +649,23 @@ theme.set_highlights = function(opts)
649649
hl(0, 'MiniStatuslineFileinfo', { bg = c.vscLeftLight, fg = c.vscFront })
650650
hl(0, 'MiniStatuslineInactive', { bg = c.vscLeftDark, fg = c.vscFront })
651651

652-
-- Neotree
653-
hl(0, 'NeoTreeBufferNumber', { fg = c.vscLineNumber, bg = 'NONE' })
654-
hl(0, 'NeoTreeCursorLine', { fg = 'NONE', bg = c.vscCursorDarkDark })
655-
hl(0, 'NeoTreeDimText', { fg = 'NONE', bg = c.vscCursorDarkDark })
656-
hl(0, 'NeoTreeDirectoryIcon', { fg = c.vscBlue, bg = 'NONE' })
657-
hl(0, 'NeoTreeDirectoryName', { fg = c.vscFront, bg = 'NONE' })
658-
hl(0, 'NeoTreeDotfile', { fg = c.vscDisabledBlue, bg = 'NONE' })
659-
hl(0, 'NeoTreeFileIcon', { fg = c.vscViolet, bg = 'NONE' })
660-
hl(0, 'NeoTreeFileName', { fg = c.vscFront, bg = 'NONE' })
661-
hl(0, 'NeoTreeFileNameOpened', { fg = c.vscFront, bg = c.vscCursorDarkDark })
662-
hl(0, 'NeoTreeFilterTerm', { fg = c.vscFront, bg = 'NONE' })
663-
hl(0, 'NeoTreeFloatBorder', { fg = c.vscLineNumber, bg = 'NONE' })
664-
hl(0, 'NeoTreeFloatTitle', { fg = c.vscLineNumber, bg = 'NONE' })
665-
hl(0, 'NeoTreeTitleBar', { fg = c.vscLineNumber, bg = 'NONE' })
652+
-- Neotree
653+
hl(0, 'NeoTreeBufferNumber', { fg = c.vscLineNumber, bg = 'NONE' })
654+
hl(0, 'NeoTreeCursorLine', { fg = 'NONE', bg = c.vscCursorDarkDark })
655+
hl(0, 'NeoTreeDimText', { fg = 'NONE', bg = c.vscCursorDarkDark })
656+
hl(0, 'NeoTreeDirectoryIcon', { fg = c.vscBlue, bg = 'NONE' })
657+
hl(0, 'NeoTreeDirectoryName', { fg = c.vscFront, bg = 'NONE' })
658+
hl(0, 'NeoTreeDotfile', { fg = c.vscDisabledBlue, bg = 'NONE' })
659+
hl(0, 'NeoTreeFileIcon', { fg = c.vscViolet, bg = 'NONE' })
660+
hl(0, 'NeoTreeFileName', { fg = c.vscFront, bg = 'NONE' })
661+
hl(0, 'NeoTreeFileNameOpened', { fg = c.vscFront, bg = c.vscCursorDarkDark })
662+
hl(0, 'NeoTreeFilterTerm', { fg = c.vscFront, bg = 'NONE' })
663+
hl(0, 'NeoTreeFloatBorder', { fg = c.vscLineNumber, bg = 'NONE' })
664+
hl(0, 'NeoTreeFloatTitle', { fg = c.vscLineNumber, bg = 'NONE' })
665+
hl(0, 'NeoTreeTitleBar', { fg = c.vscLineNumber, bg = 'NONE' })
666666

667667
-- NeogitOrg/neogit
668+
hl(0, 'NeogitWinSeparator', { link = 'WinSeparator' })
668669
if isDark then
669670
hl(0, 'NeogitDiffAdd', { fg = c.vscGitAdded, bg = c.vscDiffGreenDark })
670671
hl(0, 'NeogitDiffAddHighlight', { fg = c.vscGitAdded, bg = c.vscDiffGreenLight })
@@ -688,6 +689,12 @@ theme.set_highlights = function(opts)
688689
hl(0, 'NeogitHunkHeader', { fg = c.vscGitModified, bg = c.vscLeftMid })
689690
hl(0, 'NeogitHunkHeaderHighlight', { fg = c.vscGitModified, bg = c.vscLeftDark })
690691
end
692+
-- Cursor line highlights cause way too much distraction; rely on the
693+
-- pointer and regular highlight colors:
694+
hl(0, 'NeogitDiffAddCursor', { link = 'NeogitDiffAddHighlight' })
695+
hl(0, 'NeogitDiffContextCursor', { link = 'NeogitDiffContextHighlight' })
696+
hl(0, 'NeogitDiffDeleteCursor', { link = 'NeogitDiffDeleteHighlight' })
697+
hl(0, 'NeogitHunkHeaderCursor', { link = 'NeogitHunkHeaderHighlight' })
691698

692699
if isDark then
693700
hl(0, 'NvimTreeFolderIcon', { fg = c.vscBlue, bg = 'NONE' })

0 commit comments

Comments
 (0)