Mercurial > vim
diff src/termdefs.h @ 34136:36843e079f64 v9.1.0030
patch 9.1.0030: Cannot use terminal alternate font
Commit: https://github.com/vim/vim/commit/a606f3ac036e5f3dc313f620e6b4bc00812314f9
Author: PMunch <peterme@peterme.net>
Date: Wed Nov 15 15:35:49 2023 +0100
patch 9.1.0030: Cannot use terminal alternate font
Problem: Cannot use terminal alternate fonts (PMunch)
Solution: Support terminal alternate fonts using
CSI SGR 10-20 and t_CF code (PMunch)
Add support for alternate font highlighting
This adds support for alternate font highlighting using CSI SGR 10-20.
Few terminals currently support this, but with added tool support this
should improve over time. The change here is more or less taken from how
colors are configured and applied, but there might be some parts I
missed while implementing it. Changing fonts is done through the new
`:hi ctermfont` attribute which takes a number, 0 is the normal font, and
the numbers 1-9 select an "alternative" font. Which fonts are in use is
up to the terminal.
fixes: #13513
closes: #13537
Signed-off-by: PMunch <peterme@peterme.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 15 Jan 2024 22:30:03 +0100 |
parents | 533e36e02a68 |
children | 286bee19bc96 |
line wrap: on
line diff
--- a/src/termdefs.h +++ b/src/termdefs.h @@ -114,10 +114,11 @@ enum SpecialKey KS_SSI, // save icon text KS_SRI, // restore icon text KS_FD, // disable focus event tracking - KS_FE // enable focus event tracking + KS_FE, // enable focus event tracking + KS_CF // set terminal alternate font }; -#define KS_LAST KS_FE +#define KS_LAST KS_CF /* * the terminal capabilities are stored in this array @@ -191,6 +192,7 @@ extern char_u *(term_strings[]); // c #define T_CAF (TERM_STR(KS_CAF)) // set foreground color (ANSI) #define T_CAB (TERM_STR(KS_CAB)) // set background color (ANSI) #define T_CAU (TERM_STR(KS_CAU)) // set underline color (ANSI) +#define T_CFO (TERM_STR(KS_CF)) // set alternate font #define T_LE (TERM_STR(KS_LE)) // cursor left #define T_ND (TERM_STR(KS_ND)) // cursor right #define T_CIS (TERM_STR(KS_CIS)) // set icon text start