From d20a3dd0fb9171055cb79c5e5bc0e112d8272a4a Mon Sep 17 00:00:00 2001 From: monsta Date: Sat, 25 Feb 2017 15:47:06 +0300 Subject: 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 --- plugins/snippets/snippets/Document.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'plugins') diff --git a/plugins/snippets/snippets/Document.py b/plugins/snippets/snippets/Document.py index d832f0b9..07faf2a8 100755 --- a/plugins/snippets/snippets/Document.py +++ b/plugins/snippets/snippets/Document.py @@ -727,6 +727,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: -- cgit v1.2.1