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 | c2bf7c9b5c090d18022bcd990414b5a0c0b587c8 (patch) | |
tree | a8f86de28a056623a019c9588c370b44c3662493 | |
parent | a760eda7a7ebdf20870dfe10f9761ffc7397c861 (diff) | |
download | scintilla-mirror-c2bf7c9b5c090d18022bcd990414b5a0c0b587c8.tar.gz |
Bug [#2078]. Fix garbage text from SCI_MOVESELECTEDLINESUP and
SCI_MOVESELECTEDLINESDOWN for rectangular or thin selection by performing no
action.
-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 f6e82f658..c14d090b3 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -600,6 +600,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://www.scintilla.org/scite413.zip">Release 4.1.3</a> diff --git a/src/Editor.cxx b/src/Editor.cxx index 483d51799..baf5917e9 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1005,6 +1005,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); @@ -1057,7 +1061,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; |