diff options
author | 2017-05-26 23:24:22 -0400 | |
---|---|---|
committer | 2017-05-26 23:24:22 -0400 | |
commit | f8b7da30c0ad6fab113da731f53f261c917718d6 (patch) | |
tree | 191b4bca1f2511b50b4187a456ed88f1095000e3 /modules/textadept/snippets.lua | |
parent | 7ba72017ff94dbb1de41cc7b91cd9cae3ab1e0bb (diff) | |
download | textadept-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.lua | 5 |
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 --- |