aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2016-09-18 21:34:08 +1000
committerNeil <nyamatongwe@gmail.com>2016-09-18 21:34:08 +1000
commitbaa6e605fedb7f2394cd155caa9a9b6153169835 (patch)
tree7bd7f0819c590e77261c9f7e2fce8c8d51f19a83
parent8813b71a8538d56f78f60b1434ba69ffcdec7c89 (diff)
downloadscintilla-mirror-baa6e605fedb7f2394cd155caa9a9b6153169835.tar.gz
Bug [#1861]. Fix caret position from left/right move with rectangular selection.
-rw-r--r--doc/ScintillaHistory.html4
-rw-r--r--src/Editor.cxx12
2 files changed, 10 insertions, 6 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 5a0641749..f3f495c32 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -530,6 +530,10 @@
matching keywords that have particular prefixes and/or suffixes.
</li>
<li>
+ Fix caret position after left or right movement with rectangular selection.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1861/">Bug #1861</a>.
+ </li>
+ <li>
In SciTE, optional prefix argument added to scite.ConstantName method.
<a href="http://sourceforge.net/p/scintilla/bugs/1860/">Bug #1860</a>.
</li>
diff --git a/src/Editor.cxx b/src/Editor.cxx
index bb608d08c..b6e57212b 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -3319,13 +3319,13 @@ int Editor::HorizontalMove(unsigned int iMessage) {
sel.selType = Selection::selRectangle;
sel.Rectangular() = SelectionRange(spCaret, rangeBase.anchor);
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;
+ sel.selType = Selection::selStream;
+ sel.SetSelection(SelectionRange(selAtLimit));
} else {
- if (sel.IsRectangular()) {
- // Not a rectangular extension so switch to stream.
- SelectionPosition selAtLimit = (NaturalDirection(iMessage) > 0) ? sel.Limits().end : sel.Limits().start;
- sel.selType = Selection::selStream;
- sel.SetSelection(SelectionRange(selAtLimit));
- }
if (!additionalSelectionTyping) {
InvalidateWholeSelection();
sel.DropAdditionalRanges();