aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorColomban Wendling <ban@herbesfolles.org>2012-08-26 14:18:30 +0200
committerColomban Wendling <ban@herbesfolles.org>2012-08-26 14:18:30 +0200
commit6783c288d92d91660afa83aef636c17d8dd7c64a (patch)
tree2e30c937676316d67e5f079d08f16adacfd6135b
parent4b38afdf9de9878fe3060871c11d26fa4f18a009 (diff)
downloadscintilla-mirror-6783c288d92d91660afa83aef636c17d8dd7c64a.tar.gz
Add SCI_VCHOMEDISPLAYEXTEND keyboard command
This is like SCI_VCHOMEDISPLAY but extending the selection.
-rw-r--r--doc/ScintillaDoc.html2
-rw-r--r--include/Scintilla.h1
-rw-r--r--include/Scintilla.iface3
-rw-r--r--src/Editor.cxx12
4 files changed, 18 insertions, 0 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 770b11cae..99320a947 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -4420,6 +4420,8 @@ struct Sci_TextToFind {
<td><code>SCI_VCHOMEWRAPEXTEND</code></td>
<td><code>SCI_VCHOMEDISPLAY</code></td>
+
+ <td><code>SCI_VCHOMEDISPLAYEXTEND</code></td>
</tr>
<tr>
diff --git a/include/Scintilla.h b/include/Scintilla.h
index f415b8e59..1ee941727 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -875,6 +875,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_DESCRIBEPROPERTY 4016
#define SCI_DESCRIBEKEYWORDSETS 4017
#define SCI_VCHOMEDISPLAY 4018
+#define SCI_VCHOMEDISPLAYEXTEND 4019
#define SC_MOD_INSERTTEXT 0x1
#define SC_MOD_DELETETEXT 0x2
#define SC_MOD_CHANGESTYLE 0x4
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 677dcf855..1871d4f33 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -2332,6 +2332,9 @@ fun int DescribeKeyWordSets=4017(, stringresult descriptions)
# If already there move to first character on display line.
fun void VCHomeDisplay=4018(,)
+# Like VCHomeDisplay but extending selection to new caret position.
+fun void VCHomeDisplayExtend=4019(,)
+
# Notifications
# Type of modification and the action which caused the modification.
# These are defined as a bit mask to make it easy to specify which notifications are wanted.
diff --git a/src/Editor.cxx b/src/Editor.cxx
index eb616389f..17b899d87 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -4765,6 +4765,7 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lPar
case SCI_VCHOMEWRAP:
case SCI_VCHOMEWRAPEXTEND:
case SCI_VCHOMEDISPLAY:
+ case SCI_VCHOMEDISPLAYEXTEND:
case SCI_DELWORDLEFT:
case SCI_DELWORDRIGHT:
case SCI_DELWORDRIGHTEND:
@@ -5574,6 +5575,16 @@ int Editor::KeyCommand(unsigned int iMessage) {
StartEndDisplayLine(sel.MainCaret(), true), -1), Selection::selStream);
SetLastXChosen();
break;
+ case SCI_VCHOMEDISPLAYEXTEND: {
+ SelectionPosition homePos = SelectionPosition(pdoc->VCHomePosition(sel.MainCaret()));
+ SelectionPosition viewLineStart = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), true), -1);
+ if (viewLineStart > homePos)
+ homePos = viewLineStart;
+
+ MovePositionTo(homePos, Selection::selStream);
+ SetLastXChosen();
+ }
+ break;
case SCI_LINEENDDISPLAY:
MovePositionTo(MovePositionSoVisible(
StartEndDisplayLine(sel.MainCaret(), false), 1));
@@ -8660,6 +8671,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_VCHOMEWRAP:
case SCI_VCHOMEWRAPEXTEND:
case SCI_VCHOMEDISPLAY:
+ case SCI_VCHOMEDISPLAYEXTEND:
case SCI_ZOOMIN:
case SCI_ZOOMOUT:
case SCI_DELWORDLEFT: