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 /src | |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
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; |