diff options
author | Lewis Russell <lewis6991@gmail.com> | 2022-02-16 20:38:40 +0000 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2022-02-16 22:48:34 +0000 |
commit | dc24eeb9febaa331e660e14c3c325fd0977b6b93 (patch) | |
tree | bf6bea481594965dac41476eb27ca5360c9b8092 /src/nvim/syntax.c | |
parent | 876aaf2003d1a6eb8f0701cf11e1834751b28980 (diff) | |
download | rneovim-dc24eeb9febaa331e660e14c3c325fd0977b6b93.tar.gz rneovim-dc24eeb9febaa331e660e14c3c325fd0977b6b93.tar.bz2 rneovim-dc24eeb9febaa331e660e14c3c325fd0977b6b93.zip |
feat(highlight): support color names for cterm
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r-- | src/nvim/syntax.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 962a48822f..2b74c45478 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -8859,6 +8859,22 @@ RgbValue name_to_color(const char *name) return -1; } +int name_to_ctermcolor(const char *name) +{ + int i; + int off = TOUPPER_ASC(*name); + for (i = ARRAY_SIZE(color_names); --i >= 0;) { + if (off == color_names[i][0] + && STRICMP(name+1, color_names[i]+1) == 0) { + break; + } + } + if (i < 0) { + return -1; + } + TriState bold = kNone; + return lookup_color(i, false, &bold); +} /************************************** * End of Highlighting stuff * |