From edd672c3e5d1aff00816e2fc57f58d69b84fa019 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Tue, 29 May 2012 15:16:24 +0100 Subject: [PATCH] Don't clear styles when setting lexer id unless it has changed This fixes styles being cleared when using the Split Window plugin. --- src/sciwrappers.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sciwrappers.c b/src/sciwrappers.c index 384f3d8ec..56fc27603 100644 --- a/src/sciwrappers.c +++ b/src/sciwrappers.c @@ -531,8 +531,10 @@ gint sci_get_lexer(ScintillaObject *sci) void sci_set_lexer(ScintillaObject *sci, guint lexer_id) { + if (sci_get_lexer(sci) != (gint)lexer_id) + SSM(sci, SCI_CLEARDOCUMENTSTYLE, 0, 0); + SSM(sci, SCI_SETLEXER, lexer_id, 0); - SSM(sci, SCI_CLEARDOCUMENTSTYLE, 0, 0); } -- 2.11.4.GIT