diff options
author | mitchell <70453897+667e-11@users.noreply.github.com> | 2016-01-19 11:31:39 -0500 |
---|---|---|
committer | mitchell <70453897+667e-11@users.noreply.github.com> | 2016-01-19 11:31:39 -0500 |
commit | 34ee45b2f180af575b8a1314ca15dc3de1e98fbd (patch) | |
tree | 656c217aee39d5b3e1e4712b308c671e495e1069 /modules | |
parent | 648dd531d624a1b22601782c34156bbd1242140c (diff) |
Fixed bug in escaping '([{<' after mirrors; modules/textadept/snippets.lua
Diffstat (limited to 'modules')
-rw-r--r-- | modules/textadept/snippets.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua index 3e2aae27..e0829b1d 100644 --- a/modules/textadept/snippets.lua +++ b/modules/textadept/snippets.lua @@ -82,6 +82,12 @@ local M = {} -- Stands for a single '%' since '%' by itself has a special meaning in -- snippets. -- +-- ### `%(`<br/>`%{`<br/>`%<`<br/>`%[` +-- +-- Stands for a single '(', '{', '<', or '[', respectively, after a `%`*n* +-- mirror. Otherwise, the mirror would be interpreted as a placeholder or +-- transform. +-- -- ### `\t` -- -- A single unit of indentation based on the buffer's indentation settings @@ -178,7 +184,7 @@ local function new_snippet(text, trigger) local C, Cp, Ct, Cg, Cc = lpeg.C, lpeg.Cp, lpeg.Ct, lpeg.Cg, lpeg.Cc local patt = P{ V('plain_text') * V('placeholder') * Cp() + V('plain_text') * -1, - plain_text = C(((P(1) - '%')^1 + '%%')^0), + plain_text = C(((P(1) - '%' + '%' * S('([{<'))^1 + '%%')^0), placeholder = Ct('%' * (V('index')^-1 * (V('angles') + V('brackets') + V('braces')) * V('transform') + |