aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/snippets.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2017-05-26 23:24:22 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2017-05-26 23:24:22 -0400
commitf8b7da30c0ad6fab113da731f53f261c917718d6 (patch)
tree191b4bca1f2511b50b4187a456ed88f1095000e3 /modules/textadept/snippets.lua
parent7ba72017ff94dbb1de41cc7b91cd9cae3ab1e0bb (diff)
downloadtextadept-f8b7da30c0ad6fab113da731f53f261c917718d6.tar.gz
textadept-f8b7da30c0ad6fab113da731f53f261c917718d6.zip
Changed "Cancel Snippet" keybinding to `Esc`.
Diffstat (limited to 'modules/textadept/snippets.lua')
-rw-r--r--modules/textadept/snippets.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua
index cac83b7b..9788e36f 100644
--- a/modules/textadept/snippets.lua
+++ b/modules/textadept/snippets.lua
@@ -366,9 +366,12 @@ end
---
-- Cancels the active snippet, removing all inserted text.
+-- Returns `false` if no snippet is active.
+-- @return `false` if no snippet is active; `nil` otherwise.
-- @name _cancel_current
function M._cancel_current()
- if #snippet_stack > 0 then snippet_stack[#snippet_stack]:finish(true) end
+ if #snippet_stack == 0 then return false end
+ snippet_stack[#snippet_stack]:finish(true)
end
---