From 30faefe674c5048b7ffd31c98b1a2193c43c9fe2 Mon Sep 17 00:00:00 2001 From: Federico Igne Date: Sat, 23 May 2020 12:01:50 +0100 Subject: Apply Ligatures patch Homepage link: https://st.suckless.org/patches/ligatures/ Patch links: https://st.suckless.org/patches/ligatures/0.8.3/st-ligatures-boxdraw-20200430-0.8.3.diff https://st.suckless.org/patches/ligatures/0.8.3/st-ligatures-scrollback-20200430-0.8.3.diff Additional info: the patch was applied by mixing the two patches linked above in order to provide compatibility with both BoxDraw and Scrollback patches. --- st.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'st.h') diff --git a/st.h b/st.h index e9b3abe..70ebea0 100644 --- a/st.h +++ b/st.h @@ -4,17 +4,18 @@ #include /* macros */ -#define MIN(a, b) ((a) < (b) ? (a) : (b)) -#define MAX(a, b) ((a) < (b) ? (b) : (a)) -#define LEN(a) (sizeof(a) / sizeof(a)[0]) +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define MAX(a, b) ((a) < (b) ? (b) : (a)) +#define LEN(a) (sizeof(a) / sizeof(a)[0]) #define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b)) #define DIVCEIL(n, d) (((n) + ((d) - 1)) / (d)) #define DEFAULT(a, b) (a) = (a) ? (a) : (b) #define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x) -#define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || \ - (a).bg != (b).bg) +#define ATTRCMP(a, b) (((a).mode & (~ATTR_WRAP) & (~ATTR_LIGA)) != ((b).mode & (~ATTR_WRAP) & (~ATTR_LIGA)) || \ + (a).fg != (b).fg || \ + (a).bg != (b).bg) #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + \ - (t1.tv_nsec-t2.tv_nsec)/1E6) + (t1.tv_nsec-t2.tv_nsec)/1E6) #define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit))) #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b)) @@ -34,6 +35,7 @@ enum glyph_attribute { ATTR_WIDE = 1 << 9, ATTR_WDUMMY = 1 << 10, ATTR_BOXDRAW = 1 << 11, + ATTR_LIGA = 1 << 12, ATTR_BOLD_FAINT = ATTR_BOLD | ATTR_FAINT, }; -- cgit v1.2.3