From 53d8df95f89103127c47e5777c9a4d9d7da48a6a Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 29 Dec 2016 19:17:34 -0500 Subject: [PATCH] draw control characters with 2 ASCII characters starting with '^' --- src/gui/BufferPane.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/BufferPane.cc b/src/gui/BufferPane.cc index f7172da..306b6c1 100644 --- a/src/gui/BufferPane.cc +++ b/src/gui/BufferPane.cc @@ -234,7 +234,15 @@ int BufferPane::draw_buffer_line(int screen_row, const Buffer::Iterator & start_ saved_row_offset = row_offset; if ((code_point != '\t') && (code_point != ' ')) { - m_window->gl()->draw_character(win_x(x), win_y(y), code_point, *m_window->font()); + if (code_point < 0x20u) + { + m_window->gl()->draw_character(win_x(x), win_y(y), '^', *m_window->font()); + m_window->gl()->draw_character(win_x(col_x(screen_column + 1)), win_y(y), code_point | 0x40u, *m_window->font()); + } + else + { + m_window->gl()->draw_character(win_x(x), win_y(y), code_point, *m_window->font()); + } } } }