diff options
| -rw-r--r-- | include/Scintilla.h | 1 | ||||
| -rw-r--r-- | include/Scintilla.iface | 4 | ||||
| -rw-r--r-- | src/Editor.cxx | 12 | 
3 files changed, 17 insertions, 0 deletions
diff --git a/include/Scintilla.h b/include/Scintilla.h index 63fe4fff5..f415b8e59 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -874,6 +874,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,  #define SCI_PROPERTYTYPE 4015  #define SCI_DESCRIBEPROPERTY 4016  #define SCI_DESCRIBEKEYWORDSETS 4017 +#define SCI_VCHOMEDISPLAY 4018  #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 138730e61..677dcf855 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -2328,6 +2328,10 @@ fun int DescribeProperty=4016(string name, stringresult description)  # Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer.  fun int DescribeKeyWordSets=4017(, stringresult descriptions) +# Move caret to before first visible character on display line. +# If already there move to first character on display line. +fun void VCHomeDisplay=4018(,) +  # 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 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:  | 
