diff options
| author | nyamatongwe <unknown> | 2001-03-22 03:22:43 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2001-03-22 03:22:43 +0000 | 
| commit | fb03fe62dd45c5fd67b77ed14b86e88b3664ae1d (patch) | |
| tree | ea726ae4455230290eb826ce9927a6e7b6085f51 /src/Editor.cxx | |
| parent | d9525c42114f501c0696d1cc9a9ffb928f2a3157 (diff) | |
| download | scintilla-mirror-fb03fe62dd45c5fd67b77ed14b86e88b3664ae1d.tar.gz | |
Patch from James Larcombe for SCI_DELLINERIGHT, SCI_DELLINELEFT and
CARET_XEVEN.
Diffstat (limited to 'src/Editor.cxx')
| -rw-r--r-- | src/Editor.cxx | 21 | 
1 files changed, 20 insertions, 1 deletions
| diff --git a/src/Editor.cxx b/src/Editor.cxx index ecff9d496..81b6cf27a 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -620,7 +620,7 @@ void Editor::EnsureCaretVisible(bool useMargin, bool vert, bool horiz) {  		int xOffsetNew = xOffset;  		if (pt.x < rcClient.left) {  			xOffsetNew = xOffset - (rcClient.left - pt.x); -		} else if (((xOffset > 0) && useMargin) || pt.x >= rcClient.right) { +		} else if (((caretPolicy & CARET_XEVEN) && ((xOffset > 0) && useMargin)) || pt.x >= rcClient.right) {  			xOffsetNew = xOffset + (pt.x - rcClient.right);  			int xOffsetEOL = xOffset + (ptEOL.x - rcClient.right) - xMargin + 2;  			//Platform::DebugPrintf("Margin %d %d\n", xOffsetNew, xOffsetEOL); @@ -2012,6 +2012,8 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, unsigned long wParam, long  	case SCI_VCHOMEEXTEND:  	case SCI_DELWORDLEFT:  	case SCI_DELWORDRIGHT: +	case SCI_DELLINELEFT: +	case SCI_DELLINERIGHT:  	case SCI_LINECUT:  	case SCI_LINEDELETE:  	case SCI_LINETRANSPOSE: @@ -2298,6 +2300,21 @@ int Editor::KeyCommand(unsigned int iMessage) {  			MovePositionTo(currentPos);  		}  		break; +	case SCI_DELLINELEFT: { +			int line = pdoc->LineFromPosition(currentPos); +			int start = pdoc->LineStart(line); +			pdoc->DeleteChars(start,currentPos - start); +			MovePositionTo(start); +			SetLastXChosen(); +		} +		break; +	case SCI_DELLINERIGHT: { +			int line = pdoc->LineFromPosition(currentPos); +			int end = pdoc->LineEnd(line); +			pdoc->DeleteChars(currentPos,end - currentPos); +			MovePositionTo(currentPos); +		} +		break;  	case SCI_LINECUT: {  			int lineStart = pdoc->LineFromPosition(currentPos);  			int lineEnd = pdoc->LineFromPosition(anchor); @@ -4356,6 +4373,8 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {  	case SCI_ZOOMOUT:  	case SCI_DELWORDLEFT:  	case SCI_DELWORDRIGHT: +	case SCI_DELLINELEFT: +	case SCI_DELLINERIGHT:  	case SCI_LINECUT:  	case SCI_LINEDELETE:  	case SCI_LINETRANSPOSE: | 
