aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index 6fc55196..947876d6 100644
--- a/init.lua
+++ b/init.lua
@@ -25,6 +25,10 @@ local function set_theme(buffer, name, props)
dofile(name)
_G.buffer = orig_buffer
for prop, value in pairs(props or {}) do buffer.property[prop] = value end
+ -- Force reload of all styles since the current lexer may have defined its own
+ -- styles. (The LPeg lexer has only refreshed default lexer styles.)
+ local SETLEXERLANGUAGE = _SCINTILLA.properties.lexer_language[2]
+ buffer:private_lexer_call(SETLEXERLANGUAGE, buffer._lexer or 'text')
end
events.connect(events.BUFFER_NEW, function() buffer.set_theme = set_theme end)
buffer.set_theme = set_theme -- needed for the first buffer