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 /src | |
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.
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 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; |