Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
terminal-patch
diff --git i/src/nvim/terminal.c w/src/nvim/terminal.c
index d83197902..cac54c6ed 100644
--- i/src/nvim/terminal.c
+++ w/src/nvim/terminal.c
@@ -611,10 +611,22 @@ void terminal_get_line_attributes(Terminal *term, win_T *wp, int linenr,
.rgb_fg_color = vt_fg,
.rgb_bg_color = vt_bg,
});
}
+ // directory is usually color index 5, so for light blue directories:
+ // :hi TermColor5 ctermfg=lightblue
+ assert(vt_bg_idx <= 255 && vt_fg_idx <= 255);
+ char hl_name[sizeof("TermColor") + 3];
+ snprintf(hl_name, sizeof(hl_name), "TermColor%d", vt_fg_idx);
+ int hl_id = syn_name2id((char_u *)hl_name);
+ // ILOG("vt_fg_idx=%d hl_name=%s hl_id=%d", vt_fg_idx, hl_name, hl_id);
+ if (hl_id != 0) {
+ const int attr = syn_id2attr(hl_id);
+ attr_id = hl_combine_attr(attr, win_hl_attr(wp, hl_id));
+ }
+
if (term->cursor.visible && term->cursor.row == row
&& term->cursor.col == col) {
attr_id = hl_combine_attr(attr_id,
is_focused(term) && wp == curwin
? win_hl_attr(wp, HLF_TERM)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment