diff options
author | 2012-12-15 22:17:34 -0500 | |
---|---|---|
committer | 2012-12-15 22:17:34 -0500 | |
commit | b0daaa1699f3bfdb63c1ea9f601f266eb1642cca (patch) | |
tree | be6faf67f36c7440f0a6d2a1c08e3f6adc5040f9 /modules | |
parent | f46cbeaa27140e4b4aaa560cb100a8dbfb7cd017 (diff) | |
download | textadept-b0daaa1699f3bfdb63c1ea9f601f266eb1642cca.tar.gz textadept-b0daaa1699f3bfdb63c1ea9f601f266eb1642cca.zip |
Greatly improve speed when loading large files; modules/textadept/mime_types.lua
Diffstat (limited to 'modules')
-rw-r--r-- | modules/textadept/mime_types.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/textadept/mime_types.lua b/modules/textadept/mime_types.lua index 8193bc52..b81bdcf7 100644 --- a/modules/textadept/mime_types.lua +++ b/modules/textadept/mime_types.lua @@ -129,7 +129,8 @@ local function set_lexer(buffer, lang) if _M[lang].set_buffer_properties then _M[lang].set_buffer_properties() end events.emit(events.LANGUAGE_MODULE_LOADED, lang) end - buffer:colourise(0, -1) + local last_line = buffer.first_visible_line + buffer.lines_on_screen + buffer:colourise(0, buffer:position_from_line(last_line + 1)) -- Create the ws_styles[lexer] lookup table for `get_lexer()`. if ws_styles[lang] then return end local ws = {} |