aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVicente <unknown>2018-02-17 14:12:12 +1100
committerVicente <unknown>2018-02-17 14:12:12 +1100
commitd7aa990d9352a030615b7695c34f315217deb8c5 (patch)
tree10c6b67c6f38b7e727e74b9f98629bf25bafa7e8
parentb53c7446d596ac3eaee46325b9ce07ed300e6ce3 (diff)
downloadscintilla-mirror-d7aa990d9352a030615b7695c34f315217deb8c5.tar.gz
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.
-rw-r--r--doc/ScintillaHistory.html4
-rw-r--r--src/Editor.cxx17
2 files changed, 18 insertions, 3 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 61a4c1e0e..e438c6dfe 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -540,6 +540,10 @@
Released 12 February 2018.
</li>
<li>
+ 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.
+ </li>
+ <li>
SciTE on Windows can execute Python scripts directly by name when on path.
<a href="http://sourceforge.net/p/scintilla/feature-requests/1209/">Feature #1209.</a>
</li>
diff --git a/src/Editor.cxx b/src/Editor.cxx
index f33eefe69..64be76fa6 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<Sci::Position>(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 {
@@ -7537,7 +7548,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
std::vector<EdgeProperties>().swap(vs.theMultiEdge); // Free vector and memory, C++03 compatible
InvalidateStyleRedraw();
break;
-
+
case SCI_GETACCESSIBILITY:
return SC_ACCESSIBILITY_DISABLED;