diff options
Diffstat (limited to 'gdb/ui-style.c')
-rw-r--r-- | gdb/ui-style.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/gdb/ui-style.c b/gdb/ui-style.c index c8f2e11..d450c3e 100644 --- a/gdb/ui-style.c +++ b/gdb/ui-style.c @@ -290,6 +290,16 @@ ui_file_style::to_ansi () const else result.append (std::to_string (m_intensity)); result.push_back (';'); + if (m_italic) + result.append ("3"); + else + result.append ("23"); + result.push_back (';'); + if (m_underline) + result.append ("4"); + else + result.append ("24"); + result.push_back (';'); if (m_reverse) result.push_back ('7'); else @@ -435,6 +445,14 @@ ui_file_style::parse (const char *buf, size_t *n_read) /* Dim. */ m_intensity = DIM; break; + case 3: + /* Italic. */ + m_italic = true; + break; + case 4: + /* Underline. */ + m_underline = true; + break; case 7: /* Reverse. */ m_reverse = true; @@ -446,6 +464,14 @@ ui_file_style::parse (const char *buf, size_t *n_read) /* Normal. */ m_intensity = NORMAL; break; + case 23: + /* Non-italic. */ + m_italic = false; + break; + case 24: + /* Non-underline. */ + m_underline = false; + break; case 27: /* Inverse off. */ m_reverse = false; @@ -568,7 +594,11 @@ colorsupport () { std::vector<color_space> result = {color_space::MONOCHROME}; - int colors = tgetnum ("Co"); + /* ncurses versions prior to 6.1 (and other curses + implementations) declare the tgetnum argument to be + 'char *', so we need the const_cast, since C++ will not + implicitly convert. */ + int colors = tgetnum (const_cast<char*> ("Co")); if (colors >= 8) result.push_back (color_space::ANSI_8COLOR); if (colors >= 16) |