diff options
author | Marko Njezic <devnull@localhost> | 2011-06-09 19:43:25 +0200 |
---|---|---|
committer | Marko Njezic <devnull@localhost> | 2011-06-09 19:43:25 +0200 |
commit | a0d50960ea9fb3622d503822707dc65d864da63c (patch) | |
tree | 00bc215a90d8d45366aca83641c87cf73b96918f /src | |
parent | 695428bac032192609f23dfcdab55a2ee79b4bb0 (diff) | |
download | scintilla-mirror-a0d50960ea9fb3622d503822707dc65d864da63c.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()) { |