From f8fc742043c749768266e6b9d432b4cfeb861b28 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 22 Mar 2020 20:59:02 -0400 Subject: Use the statusbar to indicate an active snippet. This helps avoid disorienting jumps when the user is not aware a snippet is still active. --- modules/textadept/snippets.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'modules/textadept/snippets.lua') diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua index 9e1cc9dd..90617a2d 100644 --- a/modules/textadept/snippets.lua +++ b/modules/textadept/snippets.lua @@ -643,8 +643,11 @@ end -- Update snippet transforms when text is added or deleted. events.connect(events.UPDATE_UI, function(updated) - if #snippet_stack > 0 and updated and updated & buffer.UPDATE_CONTENT > 0 then - snippet_stack[#snippet_stack]:update_transforms() + if #snippet_stack > 0 then + if updated & buffer.UPDATE_CONTENT > 0 then + snippet_stack[#snippet_stack]:update_transforms() + end + if #keys.keychain == 0 then ui.statusbar_text = _L['Snippet active'] end end end) -- cgit v1.2.3