summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2017-02-25 15:47:06 +0300
committermonsta <[email protected]>2017-02-28 17:38:43 +0300
commit50be25ef9ecec0f8c68531d12ed2aff455477d02 (patch)
tree624e1f30b30ec38981026fb983efc067f82cc8fc
parentd55a183c200bdcf1c4dbddd5438eae6fe9db2133 (diff)
downloadpluma-50be25ef9ecec0f8c68531d12ed2aff455477d02.tar.bz2
pluma-50be25ef9ecec0f8c68531d12ed2aff455477d02.tar.xz
snippets plugin: fix snippet parts staying after Ctrl-Z
old issue, also present in 1.16 fix taken from: https://git.gnome.org/browse/gedit/commit/?id=bc5d893229e62c85f6956c17a8471cb5fdab10ea
-rwxr-xr-xplugins/snippets/snippets/Document.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/snippets/snippets/Document.py b/plugins/snippets/snippets/Document.py
index 368e0f5c..a87caf96 100755
--- a/plugins/snippets/snippets/Document.py
+++ b/plugins/snippets/snippets/Document.py
@@ -731,6 +731,14 @@ class Document:
self.update_snippet_contents)
def on_buffer_changed(self, buf):
+ for snippet in list(self.active_snippets):
+ begin = snippet.begin_iter()
+ end = snippet.end_iter()
+
+ if begin.compare(end) >= 0:
+ # Begin collapsed on end, just remove it
+ self.deactivate_snippet(snippet)
+
current = self.current_placeholder()
if current: