From 1698533787e71a156b2bfaabb72cdbfed93e4643 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 12 Sep 2021 06:42:28 -0700 Subject: [PATCH] A_ITALIC is not always present unlike what's documented --- babi/hl/syntax.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/babi/hl/syntax.py b/babi/hl/syntax.py index c0e962d..1bbb582 100644 --- a/babi/hl/syntax.py +++ b/babi/hl/syntax.py @@ -20,6 +20,8 @@ from babi.user_data import prefix_data from babi.user_data import xdg_config from babi.user_data import xdg_data +A_ITALIC = getattr(curses, 'A_ITALIC', 0x80000000) # not always present + class FileSyntax: include_edge = False @@ -47,7 +49,7 @@ class FileSyntax: return ( curses.color_pair(pair) | curses.A_BOLD * style.b | - curses.A_ITALIC * style.i | + A_ITALIC * style.i | curses.A_UNDERLINE * style.u )