From 041d8f30a49defcd971c32cb529c706cc036643a Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 15 Oct 2004 11:14:42 +0000 Subject: [PATCH] Don't forget to flush the bidi cache when the user enables or disables bidi or shaping, otherwise they'll have to do a manual screen refresh to see any difference. git-svn-id: svn://svn.tartarus.org/sgt/putty@4632 cda61777-01e9-0310-a592-d414129be87e --- terminal.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/terminal.c b/terminal.c index 1c10bf0f..0de47f91 100644 --- a/terminal.c +++ b/terminal.c @@ -1134,6 +1134,22 @@ void term_reconfig(Terminal *term, Config *cfg) if (term->cfg.wordness[i] != cfg->wordness[i]) reset_charclass = 1; + /* + * If the bidi or shaping settings have changed, flush the bidi + * cache completely. + */ + if (term->cfg.arabicshaping != cfg->arabicshaping || + term->cfg.bidi != cfg->bidi) { + for (i = 0; i < term->bidi_cache_size; i++) { + sfree(term->pre_bidi_cache[i].chars); + sfree(term->post_bidi_cache[i].chars); + term->pre_bidi_cache[i].width = -1; + term->pre_bidi_cache[i].chars = NULL; + term->post_bidi_cache[i].width = -1; + term->post_bidi_cache[i].chars = NULL; + } + } + term->cfg = *cfg; /* STRUCTURE COPY */ if (reset_wrap) -- 2.11.0