From a0d50960ea9fb3622d503822707dc65d864da63c Mon Sep 17 00:00:00 2001 From: Marko Njezic Date: Thu, 9 Jun 2011 19:43:25 +0200 Subject: Group inserted spaces in virtual space together with deletion. Bug #3159691. --- src/Editor.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index ee6836acd..6b86987fa 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4193,7 +4193,13 @@ bool Editor::CanPaste() { void Editor::Clear() { // If multiple selections, don't delete EOLS if (sel.Empty()) { - UndoGroup ug(pdoc, sel.Count() > 1); + bool singleVirtual = false; + if ((sel.Count() == 1) && + !RangeContainsProtected(sel.MainCaret(), sel.MainCaret() + 1) && + sel.RangeMain().Start().VirtualSpace()) { + singleVirtual = true; + } + UndoGroup ug(pdoc, (sel.Count() > 1) || singleVirtual); for (size_t r=0; r