From dea75986e133ed9e54cb67ec0a87c80b7867b5c4 Mon Sep 17 00:00:00 2001 From: Vicente Date: Sat, 17 Feb 2018 14:12:12 +1100 Subject: Backport: For rectangular selections, pressing Home or End now moves the caret to the Home or End position instead of the limit of the rectangular selection. Backport of changeset 6456:eaa6c7fa1a81. --- doc/ScintillaHistory.html | 4 ++++ src/Editor.cxx | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index e146fe692..1734970e6 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -581,6 +581,10 @@ complex selection commands.
  • + For rectangular selections, pressing Home or End now moves the caret to the Home or End + position instead of the limit of the rectangular selection. +
  • +
  • Fix HTML lexer handling of Django so that nesting a {{ }} or {% %} Django tag inside of a {# #} Django comment does not break highlighting of rest of file
  • diff --git a/src/Editor.cxx b/src/Editor.cxx index 63b41a4d5..e810a8742 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3359,8 +3359,19 @@ int Editor::HorizontalMove(unsigned int iMessage) { SetRectangularRange(); } else if (sel.IsRectangular()) { // Not a rectangular extension so switch to stream. - const SelectionPosition selAtLimit = - (NaturalDirection(iMessage) > 0) ? sel.Limits().end : sel.Limits().start; + SelectionPosition selAtLimit = (NaturalDirection(iMessage) > 0) ? sel.Limits().end : sel.Limits().start; + switch (iMessage) { + case SCI_HOME: + selAtLimit = SelectionPosition( + static_cast(pdoc->LineStart(pdoc->LineFromPosition(selAtLimit.Position())))); + break; + case SCI_VCHOME: + selAtLimit = SelectionPosition(pdoc->VCHomePosition(selAtLimit.Position())); + break; + case SCI_LINEEND: + selAtLimit = SelectionPosition(pdoc->LineEndPosition(selAtLimit.Position())); + break; + } sel.selType = Selection::selStream; sel.SetSelection(SelectionRange(selAtLimit)); } else { @@ -7528,7 +7539,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { std::vector().swap(vs.theMultiEdge); // Free vector and memory, C++03 compatible InvalidateStyleRedraw(); break; - + case SCI_GETACCESSIBILITY: return SC_ACCESSIBILITY_DISABLED; -- cgit v1.2.3