diff options
| author | nyamatongwe <unknown> | 2001-12-23 01:03:32 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2001-12-23 01:03:32 +0000 | 
| commit | 99a53fdd7a539a4aea54fea0d658ba40ff6aaeaf (patch) | |
| tree | 2c374b8d4aea33e4e720c50a7d55749c373a292e | |
| parent | a8af8d9c4f76eb50cec4bd877787d6b04d5a821f (diff) | |
| download | scintilla-mirror-99a53fdd7a539a4aea54fea0d658ba40ff6aaeaf.tar.gz | |
Fixed MovePositionSoVisible so that when navigating with arrow keys, the
caret will move over folds correctly.
| -rw-r--r-- | src/Editor.cxx | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/src/Editor.cxx b/src/Editor.cxx index 5f43d5871..53b38f827 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -585,12 +585,12 @@ int Editor::MovePositionSoVisible(int pos, int moveDir) {  	} else {  		int lineDisplay = cs.DisplayFromDoc(lineDoc);  		if (moveDir > 0) { -			lineDisplay = Platform::Clamp(lineDisplay + 1, 0, cs.LinesDisplayed()); +			// lineDisplay is already line before fold as lines in fold use display line of line after fold +			lineDisplay = Platform::Clamp(lineDisplay, 0, cs.LinesDisplayed());  			return pdoc->LineStart(cs.DocFromDisplay(lineDisplay));  		} else { -			// lineDisplay is already line before fold as lines in fold use display line of line before fold -			lineDisplay = Platform::Clamp(lineDisplay, 0, cs.LinesDisplayed()); -			return pdoc->LineEndPosition(pdoc->LineStart(cs.DocFromDisplay(lineDisplay))); +			lineDisplay = Platform::Clamp(lineDisplay - 1, 0, cs.LinesDisplayed()); +			return pdoc->LineEnd(cs.DocFromDisplay(lineDisplay));  		}  	}  } | 
