aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx8
1 files changed, 7 insertions, 1 deletions
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<sel.Count(); r++) {
if (!RangeContainsProtected(sel.Range(r).caret.Position(), sel.Range(r).caret.Position() + 1)) {
if (sel.Range(r).Start().VirtualSpace()) {