diff options
author | monsta <[email protected]> | 2017-02-25 15:47:06 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2017-02-25 16:07:35 +0300 |
commit | d20a3dd0fb9171055cb79c5e5bc0e112d8272a4a (patch) | |
tree | 4750de63781e5885a55bfd95679293e438ff4419 /plugins/snippets | |
parent | c45e91b0f617455d6cf2197e712f0c34c5b0090c (diff) | |
download | pluma-d20a3dd0fb9171055cb79c5e5bc0e112d8272a4a.tar.bz2 pluma-d20a3dd0fb9171055cb79c5e5bc0e112d8272a4a.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
Diffstat (limited to 'plugins/snippets')
-rwxr-xr-x | plugins/snippets/snippets/Document.py | 8 |
1 files changed, 8 insertions, 0 deletions
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: |