diff options
author | Marko Njezic <unknown> | 2011-06-09 19:43:25 +0200 |
---|---|---|
committer | Marko Njezic <unknown> | 2011-06-09 19:43:25 +0200 |
commit | 89d5dace8895fa0ead34f74cb110e80691bd0bb2 (patch) | |
tree | 612da9b2885302e034c02e2f43a22c724322fe0b /src | |
parent | e9a1d350576ba28bab810d5de825dfb02be03ddb (diff) | |
download | scintilla-mirror-89d5dace8895fa0ead34f74cb110e80691bd0bb2.tar.gz |
Group inserted spaces in virtual space together with deletion. Bug #3159691.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 8 |
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()) { |