diff options
| author | nyamatongwe <devnull@localhost> | 2002-08-02 04:26:31 +0000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2002-08-02 04:26:31 +0000 | 
| commit | 8c3d04133a3f62b7de96312fea83e290f6474be0 (patch) | |
| tree | e492b814d74d06890281c363b53580d6eab6f56e /src/Editor.cxx | |
| parent | e29871a7cabc35175586d0d276c7eb6bc9b3be3d (diff) | |
| download | scintilla-mirror-8c3d04133a3f62b7de96312fea83e290f6474be0.tar.gz | |
Made Ctrl+Up and Ctrl+Down not flicker when using strict caret policy.
Avoided by not calling EnsureCaretVisible for these keys.
Diffstat (limited to 'src/Editor.cxx')
| -rw-r--r-- | src/Editor.cxx | 17 | 
1 files changed, 10 insertions, 7 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index c857d2e71..76dbd1ba7 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -836,7 +836,7 @@ int Editor::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) {  	return pos;  } -int Editor::MovePositionTo(int newPos, bool extend) { +int Editor::MovePositionTo(int newPos, bool extend, bool ensureVisible) {  	int delta = newPos - currentPos;  	newPos = pdoc->ClampPositionIntoDocument(newPos);  	newPos = MovePositionOutsideChar(newPos, delta); @@ -845,7 +845,8 @@ int Editor::MovePositionTo(int newPos, bool extend) {  	} else {  		SetEmptySelection(newPos);  	} -	EnsureCaretVisible(); +	if (ensureVisible) +		EnsureCaretVisible();  	ShowCaretAtCurrentPosition();  	NotifyMove(newPos);  	return 0; @@ -909,16 +910,18 @@ void Editor::HorizontalScrollTo(int xPos) {  	}  } -void Editor::MoveCaretInsideView() { +void Editor::MoveCaretInsideView(bool ensureVisible) {  	PRectangle rcClient = GetTextRectangle();  	Point pt = LocationFromPosition(currentPos);  	if (pt.y < rcClient.top) {  		MovePositionTo(PositionFromLocation( -		                   Point(lastXChosen, rcClient.top))); +		                   Point(lastXChosen, rcClient.top)), +						   false, ensureVisible);  	} else if ((pt.y + vs.lineHeight - 1) > rcClient.bottom) {  		int yOfLastLineFullyDisplayed = rcClient.top + (LinesOnScreen() - 1) * vs.lineHeight;  		MovePositionTo(PositionFromLocation( -		                   Point(lastXChosen, rcClient.top + yOfLastLineFullyDisplayed))); +		                   Point(lastXChosen, rcClient.top + yOfLastLineFullyDisplayed)), +						   false, ensureVisible);  	}  } @@ -3180,7 +3183,7 @@ int Editor::KeyCommand(unsigned int iMessage) {  		break;  	case SCI_LINESCROLLDOWN:  		ScrollTo(topLine + 1); -		MoveCaretInsideView(); +		MoveCaretInsideView(false);  		break;  	case SCI_LINEUP:  		CursorUpOrDown(-1); @@ -3190,7 +3193,7 @@ int Editor::KeyCommand(unsigned int iMessage) {  		break;  	case SCI_LINESCROLLUP:  		ScrollTo(topLine - 1); -		MoveCaretInsideView(); +		MoveCaretInsideView(false);  		break;  	case SCI_CHARLEFT:  		if (SelectionEmpty()) {  | 
