From 34ee45b2f180af575b8a1314ca15dc3de1e98fbd Mon Sep 17 00:00:00 2001
From: mitchell <70453897+667e-11@users.noreply.github.com>
Date: Tue, 19 Jan 2016 11:31:39 -0500
Subject: Fixed bug in escaping '([{<' after mirrors;
modules/textadept/snippets.lua
---
modules/textadept/snippets.lua | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
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.
--
+-- ### `%(`
`%{`
`%<`
`%[`
+--
+-- 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') +
--
cgit v1.2.3