aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2015-11-12 09:35:33 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2015-11-12 09:35:33 -0500
commita141b1d13f127dbea0874ccf125df6266da7ae39 (patch)
tree7d5113424ef1bf4e5fba1b2014e9229cf0be9a38 /modules
parent673fdedc04133e10f96c3b1b3b32c9b8bbc54a5b (diff)
downloadtextadept-a141b1d13f127dbea0874ccf125df6266da7ae39.tar.gz
textadept-a141b1d13f127dbea0874ccf125df6266da7ae39.zip
Fixed '%' escape sequences in snippets; modules/textadept/snippets.lua
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/snippets.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua
index bfb43bb9..1584dc13 100644
--- a/modules/textadept/snippets.lua
+++ b/modules/textadept/snippets.lua
@@ -277,7 +277,9 @@ local function new_snippet(text, trigger)
placeholder.position = snippet.start_pos + placeholder.position -- absolute
text_part, placeholder, e = patt:match(text, e)
end
- if text_part ~= '' then snapshot.text = snapshot.text..text_part end
+ if text_part ~= '' then
+ snapshot.text = snapshot.text..text_part:gsub('%%(%p)', '%1')
+ end
snippet.snapshots[0] = snapshot
-- Insert the snippet into the buffer and mark its end position.