From 52070ea5775d31b308718a31563215ec48638b6d Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 31 Mar 2012 17:24:11 -0700 Subject: [PATCH] Fix to properly update colors for non-native term256 support --- output.cpp | 9 ++++++++- reader.cpp | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/output.cpp b/output.cpp index 56e58f075..96030c5d5 100644 --- a/output.cpp +++ b/output.cpp @@ -166,7 +166,14 @@ static bool write_color(char *todo, unsigned char idx, bool is_fg) { strcat(buff, is_fg ? "38;5;" : "48;5;"); strcat(buff, stridx); strcat(buff, "m"); - write_loop(STDOUT_FILENO, buff, strlen(buff)); + + int (*writer)(char) = output_get_writer(); + if (writer) { + for (size_t i=0; buff[i]; i++) { + writer(buff[i]); + } + } + result = true; } return result; diff --git a/reader.cpp b/reader.cpp index 5bf7cebb4..cc31808a8 100644 --- a/reader.cpp +++ b/reader.cpp @@ -714,7 +714,7 @@ void reader_repaint_if_needed() { void reader_react_to_color_change() { if (data) { - data->repaint_needed = true; + data->repaint_needed = true; data->screen_reset_needed = true; } }