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 | 1f4b5abefa8e7e1ca19e290898b7fa1a5103cd7c (patch) | |
| tree | e56c27e88d6178a73a26a82dd9ec3b1b09c2339c /src | |
| parent | dcc97971562b924d0cc488b8c9b486c5ded88f1c (diff) | |
| download | scintilla-mirror-1f4b5abefa8e7e1ca19e290898b7fa1a5103cd7c.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:  | 
