From 6783c288d92d91660afa83aef636c17d8dd7c64a Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Sun, 26 Aug 2012 14:18:30 +0200 Subject: Add SCI_VCHOMEDISPLAYEXTEND keyboard command This is like SCI_VCHOMEDISPLAY but extending the selection. --- src/Editor.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') 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: -- cgit v1.2.3