aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2015-10-07 09:28:12 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2015-10-07 09:28:12 -0400
commit2589e6b2eeaf5e82c3caaf1a7fd8c60ed7d2d149 (patch)
treed33942ef205ddee9bf87d173eb916a86377f8fc7 /modules
parenta7d479becd5b94e92e11552dacf51c31abcbcae4 (diff)
downloadtextadept-2589e6b2eeaf5e82c3caaf1a7fd8c60ed7d2d149.tar.gz
textadept-2589e6b2eeaf5e82c3caaf1a7fd8c60ed7d2d149.zip
Fixed potential bug in UPDATE_UI handler; modules/textadept/snippets.lua
It's possible for the `updated` parameter to be `nil`; handle it.
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/snippets.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua
index 2c2bbf15..5c039d12 100644
--- a/modules/textadept/snippets.lua
+++ b/modules/textadept/snippets.lua
@@ -530,7 +530,8 @@ M._snippet_mt = {
-- Update snippet transforms when text is added or deleted.
events.connect(events.UPDATE_UI, function(updated)
- if #snippet_stack > 0 and bit32.band(updated, buffer.UPDATE_CONTENT) > 0 then
+ if #snippet_stack > 0 and updated and
+ bit32.band(updated, buffer.UPDATE_CONTENT) > 0 then
snippet_stack[#snippet_stack]:update_transforms()
end
end)