aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2016-04-05 20:46:20 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2016-04-05 20:46:20 -0400
commit867e24ad43c2a253ba637da612f5edf7741b3ca6 (patch)
tree006fcb5167c14ea9e51a75172fae743fba9014ad
parent6e086c1310caa4182e919a9ba6fe35f6c3bf3725 (diff)
downloadtextadept-867e24ad43c2a253ba637da612f5edf7741b3ca6.tar.gz
textadept-867e24ad43c2a253ba637da612f5edf7741b3ca6.zip
Do not run some `events.UPDATE_UI` handlers when scrolling.
-rw-r--r--core/ui.lua3
-rw-r--r--modules/textadept/editing.lua3
2 files changed, 4 insertions, 2 deletions
diff --git a/core/ui.lua b/core/ui.lua
index 1392876f..1df96e45 100644
--- a/core/ui.lua
+++ b/core/ui.lua
@@ -337,7 +337,8 @@ end)
local EOLs = {_L['CRLF'], _L['CR'], _L['LF']}
local GETLEXERLANGUAGE = _SCINTILLA.properties.lexer_language[1]
-- Sets buffer statusbar text.
-events_connect(events.UPDATE_UI, function()
+events_connect(events.UPDATE_UI, function(updated)
+ if updated and bit32.band(updated, 3) == 0 then return end -- ignore scrolling
local pos = buffer.current_pos
local line, max = buffer:line_from_position(pos) + 1, buffer.line_count
local col = buffer.column[pos] + 1
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 93c180b7..8e6126a6 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -157,7 +157,8 @@ events.connect(events.KEYPRESS, function(code)
end)
-- Highlights matching braces.
-events.connect(events.UPDATE_UI, function()
+events.connect(events.UPDATE_UI, function(updated)
+ if updated and bit32.band(updated, 3) == 0 then return end -- ignore scrolling
local pos = buffer.current_pos
if (M.braces[buffer:get_lexer(true)] or M.braces)[buffer.char_at[pos]] then
local match = buffer:brace_match(pos)