diff options
author | 2020-02-18 09:51:04 -0500 | |
---|---|---|
committer | 2020-02-18 09:51:04 -0500 | |
commit | 7db3550b3cdffaeacb6c8455a6c6de77fb5ddd27 (patch) | |
tree | 5ab4aada2657ba4c623377c890b6fc198f1f62e7 /modules/textadept | |
parent | 6cf7aabf04289bf1f8a68dd269b4a70fbfbef342 (diff) | |
download | textadept-7db3550b3cdffaeacb6c8455a6c6de77fb5ddd27.tar.gz textadept-7db3550b3cdffaeacb6c8455a6c6de77fb5ddd27.zip |
Fixed bug when snippet end placeholder is lost.
The first character in the snippet was being deleted. An example of the end
placeholder being lost is when it and the caret are at the end of the line and
Enter is pressed -- the autoindent feature appears to delete it.
This fix assumes a snippet of at least length 1 was inserted.
Diffstat (limited to 'modules/textadept')
-rw-r--r-- | modules/textadept/snippets.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua index cd41c635..7fcfe55e 100644 --- a/modules/textadept/snippets.lua +++ b/modules/textadept/snippets.lua @@ -517,7 +517,7 @@ M._snippet_mt = { -- `true`, the buffer is restored to its state prior to snippet expansion. finish = function(self, canceling) local s, e = self.start_pos, self.end_pos - buffer:delete_range(e, 1) -- clear initial padding space + if e ~= s then buffer:delete_range(e, 1) end -- clear initial padding space if not canceling then buffer.indicator_current = M.INDIC_PLACEHOLDER buffer:indicator_clear_range(s, e - s) |