comparison src/gui.c @ 25982:aade8ef975d5 v8.2.3524

patch 8.2.3524: GUI: ligatures are not used Commit: https://github.com/vim/vim/commit/4eeedc09fed0cbbb3ba48317e0a01e20cd0b4f80 Author: Dusan Popovic <dpx@binaryapparatus.com> Date: Sat Oct 16 20:52:05 2021 +0100 patch 8.2.3524: GUI: ligatures are not used Problem: GUI: ligatures are not used. Solution: Add the 'guiligatures' option. (Dusan Popovic, closes https://github.com/vim/vim/issues/8933)
author Bram Moolenaar <Bram@vim.org>
date Sat, 16 Oct 2021 22:00:05 +0200
parents 078edc1821bf
children 92c424550367
comparison
equal deleted inserted replaced
25981:483b3a06ac68 25982:aade8ef975d5
457 gui.tooltip_fontset = NOFONTSET; 457 gui.tooltip_fontset = NOFONTSET;
458 #endif 458 #endif
459 459
460 gui.scrollbar_width = gui.scrollbar_height = SB_DEFAULT_WIDTH; 460 gui.scrollbar_width = gui.scrollbar_height = SB_DEFAULT_WIDTH;
461 gui.prev_wrap = -1; 461 gui.prev_wrap = -1;
462
463 # ifdef FEAT_GUI_GTK
464 CLEAR_FIELD(gui.ligatures_map);
465 #endif
462 466
463 #if defined(ALWAYS_USE_GUI) || defined(VIMDLL) 467 #if defined(ALWAYS_USE_GUI) || defined(VIMDLL)
464 result = OK; 468 result = OK;
465 #else 469 #else
466 # ifdef FEAT_GUI_GTK 470 # ifdef FEAT_GUI_GTK
1062 * support those fonts for 'guifontwide'. 1066 * support those fonts for 'guifontwide'.
1063 */ 1067 */
1064 #endif 1068 #endif
1065 return OK; 1069 return OK;
1066 } 1070 }
1071
1072 #if defined(FEAT_GUI_GTK) || defined(PROTO)
1073 /*
1074 * Set list of ascii characters that combined can create ligature.
1075 * Store them in char map for quick access from gui_gtk2_draw_string.
1076 */
1077 void
1078 gui_set_ligatures(void)
1079 {
1080 char_u *p;
1081
1082 if (*p_guiligatures != NUL)
1083 {
1084 // check for invalid characters
1085 for (p = p_guiligatures; *p != NUL; ++p)
1086 if (*p < 32 || *p > 127)
1087 {
1088 emsg(_(e_ascii_code_not_in_range));
1089 return;
1090 }
1091
1092 // store valid setting into ligatures_map
1093 CLEAR_FIELD(gui.ligatures_map);
1094 for (p = p_guiligatures; *p != NUL; ++p)
1095 gui.ligatures_map[*p] = 1;
1096 }
1097 else
1098 CLEAR_FIELD(gui.ligatures_map);
1099 }
1100 #endif
1067 1101
1068 static void 1102 static void
1069 gui_set_cursor(int row, int col) 1103 gui_set_cursor(int row, int col)
1070 { 1104 {
1071 gui.row = row; 1105 gui.row = row;