diff options
author | nyamatongwe <devnull@localhost> | 2012-02-18 20:13:47 +1100 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2012-02-18 20:13:47 +1100 |
commit | e63ad7124356e0dc27c152d6bc417e57a6bde4d0 (patch) | |
tree | 1d7ceca9714a23db6358e6707764c3404de77d27 /src | |
parent | f2b6a8c89a176007c7584fb2ae77e74f5871ec5d (diff) | |
download | scintilla-mirror-e63ad7124356e0dc27c152d6bc417e57a6bde4d0.tar.gz |
Wrap lines if needed when moving to a position. Bug #3487397.
From Marko Njezic.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 58271db47..e9b66fcce 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -909,7 +909,12 @@ int Editor::MovePositionTo(SelectionPosition newPos, Selection::selTypes selt, b SetEmptySelection(newPos); } ShowCaretAtCurrentPosition(); + + int currentLine = pdoc->LineFromPosition(newPos.Position()); if (ensureVisible) { + // In case in need of wrapping to ensure DisplayFromDoc works. + if (currentLine >= wrapStart) + WrapLines(true, -1); XYScrollPosition newXY = XYScrollToMakeVisible(true, true, true); if (simpleCaret && (newXY.xOffset == xOffset)) { // simple vertical scroll then invalidate @@ -920,8 +925,6 @@ int Editor::MovePositionTo(SelectionPosition newPos, Selection::selTypes selt, b } } - int currentLine = pdoc->LineFromPosition(newPos.Position()); - if (highlightDelimiter.NeedsDrawing(currentLine)) { RedrawSelMargin(); } @@ -6891,7 +6894,8 @@ int Editor::ContractedFoldNext(int lineStart) { void Editor::EnsureLineVisible(int lineDoc, bool enforcePolicy) { // In case in need of wrapping to ensure DisplayFromDoc works. - WrapLines(true, -1); + if (lineDoc >= wrapStart) + WrapLines(true, -1); if (!cs.GetVisible(lineDoc)) { int lookLine = lineDoc; |