On 16-Jan-2024 08:30, Christian Brabandt wrote:
patch 9.1.0030: Cannot use terminal alternate font

Commit:https://github.com/vim/vim/commit/a606f3ac036e5f3dc313f620e6b4bc00812314f9
Author: PMunch<[email protected]>
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<[email protected]>
     Signed-off-by: Christian Brabandt<[email protected]>


After this patch, clang x64 17.0.6 (msys2 on Windows 10), gives this warning:
<snip>
clang -c -I. -Iproto -DWIN32 -DWINVER=0x0A00 -D_WIN32_WINNT=0x0A00 -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO -pipe -Wall -O3 -fomit-frame-pointer -fpie -fPIE  term.c -o objx86-64/term.o
term.c:640:21: warning: unused variable 'special_term' [-Wunused-variable]

  640 | static tcap_entry_T special_term[] = {

      |                     ^~~~~~~~~~~~

1 warning generated.

</snip>

The attached patch tries to fix it.

Cheers
John

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/5f94db2f-3bdb-455f-8135-2f3011256913%40internode.on.net.
--- term.c.orig 2024-01-17 05:53:12.745304200 +1100
+++ term.c      2024-01-17 06:04:53.648668300 +1100
@@ -637,11 +637,13 @@
 };
 #endif
 
+#ifdef HAVE_TGETENT
 static tcap_entry_T special_term[] = {
     // These are printf strings, not terminal codes.
     {(int)KS_CF,       "\033[%dm"},
     {(int)KS_NAME,     NULL}  // end marker
 };
+#endif
 
 /*
  * iris-ansi for Silicon Graphics machines.

Raspunde prin e-mail lui