summaryrefslogtreecommitdiff
path: root/src/fe-text/textbuffer.c
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2017-01-31 14:17:44 +0100
committerGitHub <noreply@github.com>2017-01-31 14:17:44 +0100
commit4031b92b9b88a0492d5f77e4d61bf31fabaf9e96 (patch)
treebe3e378d1019c4f3fd89008c49bfecdc7dc71b5c /src/fe-text/textbuffer.c
parent228f487a69cc032b368a0ae0daea6796b7d10d6e (diff)
parent98435fb4649367c182e35aea8c89ce7a4cf8d4d3 (diff)
downloadirssi-4031b92b9b88a0492d5f77e4d61bf31fabaf9e96.zip
Merge pull request #626 from ailin-nemui/textbuffer_monospace
support storing and replaying the monospace attribute in textbuffer
Diffstat (limited to 'src/fe-text/textbuffer.c')
-rw-r--r--src/fe-text/textbuffer.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fe-text/textbuffer.c b/src/fe-text/textbuffer.c
index ae4636a5..3668f4c7 100644
--- a/src/fe-text/textbuffer.c
+++ b/src/fe-text/textbuffer.c
@@ -326,6 +326,10 @@ void textbuffer_line_add_colors(TEXT_BUFFER_REC *buffer, LINE_REC **line,
data[pos++] = 0;
data[pos++] = LINE_CMD_ITALIC;
}
+ if ((flags & GUI_PRINT_FLAG_MONOSPACE) != (buffer->last_flags & GUI_PRINT_FLAG_MONOSPACE)) {
+ data[pos++] = 0;
+ data[pos++] = LINE_CMD_MONOSPACE;
+ }
if (flags & GUI_PRINT_FLAG_INDENT) {
data[pos++] = 0;
data[pos++] = LINE_CMD_INDENT;
@@ -509,6 +513,10 @@ void textbuffer_line2text(LINE_REC *line, int coloring, GString *str)
g_string_append_printf(str, "\004%c",
FORMAT_STYLE_ITALIC);
break;
+ case LINE_CMD_MONOSPACE:
+ g_string_append_printf(str, "\004%c",
+ FORMAT_STYLE_MONOSPACE);
+ break;
case LINE_CMD_COLOR0:
g_string_append_printf(str, "\004%c%c",
'0', FORMAT_COLOR_NOCHANGE);