diff options
author | Neil <nyamatongwe@gmail.com> | 2019-02-09 19:54:22 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2019-02-09 19:54:22 +1100 |
commit | c2fed374732bfece2e47c759f7d74b35bf743481 (patch) | |
tree | 4c094de22b198b5f23081ba3099ee758b9511455 | |
parent | 08b7ba9c6804232efe62a7cb970013548318417f (diff) | |
download | scintilla-mirror-c2fed374732bfece2e47c759f7d74b35bf743481.tar.gz |
Backport: Bug [#2078]. Fix garbage text from SCI_MOVESELECTEDLINESUP and
SCI_MOVESELECTEDLINESDOWN for rectangular or thin selection by performing no
action.
Backport of changeset 7251:df5c32512d3d.
-rw-r--r-- | doc/ScintillaHistory.html | 5 | ||||
-rw-r--r-- | src/Editor.cxx | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index d34f4bf2e..6eaa883ae 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -586,6 +586,11 @@ Fix TCL lexer recognizing '"' after "," inside a bracketed substitution. <a href="https://sourceforge.net/p/scintilla/bugs/1947/">Bug #1947</a>. </li> + <li> + Fix garbage text from SCI_MOVESELECTEDLINESUP and SCI_MOVESELECTEDLINESDOWN + for rectangular or thin selection by performing no action. + <a href="https://sourceforge.net/p/scintilla/bugs/2078/">Bug #2078</a>. + </li> </ul> <h3> <a href="https://sourceforge.net/projects/scintilla/files/scintilla/3.10.2/scintilla3102.zip/download">Release 3.10.2</a> diff --git a/src/Editor.cxx b/src/Editor.cxx index e6a1637f9..fd21e47bb 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1002,6 +1002,10 @@ void Editor::VerticalCentreCaret() { void Editor::MoveSelectedLines(int lineDelta) { + if (sel.IsRectangular()) { + return; + } + // if selection doesn't start at the beginning of the line, set the new start Sci::Position selectionStart = SelectionStart().Position(); const Sci::Line startLine = pdoc->SciLineFromPosition(selectionStart); @@ -1054,7 +1058,7 @@ void Editor::MoveSelectedLines(int lineDelta) { pdoc->InsertString(pdoc->Length(), eol, strlen(eol)); GoToLine(currentLine + lineDelta); - selectionLength = pdoc->InsertString(CurrentPosition(), selectedText.Data(), selectionLength); + selectionLength = pdoc->InsertString(CurrentPosition(), selectedText.Data(), selectedText.Length()); if (appendEol) { const Sci::Position lengthInserted = pdoc->InsertString(CurrentPosition() + selectionLength, eol, strlen(eol)); selectionLength += lengthInserted; |