diff options
author | PMunch <peterme@peterme.net> | 2023-11-15 15:35:49 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-01-15 22:27:35 +0100 |
commit | a606f3ac036e5f3dc313f620e6b4bc00812314f9 (patch) | |
tree | c27363e3163007004f8838482137a5db5bf28630 /src/testdir | |
parent | eb3475df0d927a178789cf8e7fc4983932e1cdbe (diff) |
patch 9.1.0030: Cannot use terminal alternate fontv9.1.0030
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>
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_highlight.vim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/testdir/test_highlight.vim b/src/testdir/test_highlight.vim index af60503132..b831878b40 100644 --- a/src/testdir/test_highlight.vim +++ b/src/testdir/test_highlight.vim @@ -888,6 +888,16 @@ func Test_highlight_ctermul() highlight Normal ctermul=NONE endfunc +" Test for 'ctermfont' in a highlight group +func Test_highlight_ctermfont() + CheckNotGui + call assert_notmatch('ctermfont=', HighlightArgs('Normal')) + highlight Normal ctermfont=3 + call assert_match('ctermfont=3', HighlightArgs('Normal')) + call assert_equal('3', synIDattr(synIDtrans(hlID('Normal')), 'font')) + highlight Normal ctermfont=NONE +endfunc + " Test for specifying 'start' and 'stop' in a highlight group func Test_highlight_start_stop() hi HlGrp1 start=<Esc>[27h;<Esc>[<Space>r; @@ -1314,6 +1324,7 @@ func Test_hlset() call hlset([{'name': 'hlg11', 'ctermfg': ''}]) call hlset([{'name': 'hlg11', 'ctermbg': ''}]) call hlset([{'name': 'hlg11', 'ctermul': ''}]) + call hlset([{'name': 'hlg11', 'ctermfont': ''}]) call hlset([{'name': 'hlg11', 'font': ''}]) call hlset([{'name': 'hlg11', 'gui': {}}]) call hlset([{'name': 'hlg11', 'guifg': ''}]) |