diff options
author | Colomban Wendling <ban@herbesfolles.org> | 2012-08-25 00:07:55 +0200 |
---|---|---|
committer | Colomban Wendling <ban@herbesfolles.org> | 2012-08-25 00:07:55 +0200 |
commit | d88283eb94e318406cf3b6c1c3d489668ac8e804 (patch) | |
tree | 7ed258d66aefa1c70e282f4c3361f468187e4454 /src | |
parent | 8fb28f024bf597b55e8dbdf2bd11e3f9d69a5a41 (diff) | |
download | scintilla-mirror-d88283eb94e318406cf3b6c1c3d489668ac8e804.tar.gz |
Add SCI_VCHOMEDISPLAY keyboard command
This works like SCI_HOMEDISPLAY but goes to the first visible character
if on a logical line, like does SCI_VCHOME. This command makes it
possible to use display-line-aware commands while keeping the "smart
home" feature.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 4a52f38ce..eb616389f 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4764,6 +4764,7 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lPar case SCI_VCHOMEEXTEND: case SCI_VCHOMEWRAP: case SCI_VCHOMEWRAPEXTEND: + case SCI_VCHOMEDISPLAY: case SCI_DELWORDLEFT: case SCI_DELWORDRIGHT: case SCI_DELWORDRIGHTEND: @@ -5558,6 +5559,16 @@ int Editor::KeyCommand(unsigned int iMessage) { StartEndDisplayLine(sel.MainCaret(), true), -1)); SetLastXChosen(); break; + case SCI_VCHOMEDISPLAY: { + SelectionPosition homePos = SelectionPosition(pdoc->VCHomePosition(sel.MainCaret())); + SelectionPosition viewLineStart = MovePositionSoVisible(StartEndDisplayLine(sel.MainCaret(), true), -1); + if (viewLineStart > homePos) + homePos = viewLineStart; + + MovePositionTo(homePos); + SetLastXChosen(); + } + break; case SCI_HOMEDISPLAYEXTEND: MovePositionTo(MovePositionSoVisible( StartEndDisplayLine(sel.MainCaret(), true), -1), Selection::selStream); @@ -8648,6 +8659,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_VCHOMEEXTEND: case SCI_VCHOMEWRAP: case SCI_VCHOMEWRAPEXTEND: + case SCI_VCHOMEDISPLAY: case SCI_ZOOMIN: case SCI_ZOOMOUT: case SCI_DELWORDLEFT: |