diff options
author | nyamatongwe <unknown> | 2012-02-18 20:13:47 +1100 |
---|---|---|
committer | nyamatongwe <unknown> | 2012-02-18 20:13:47 +1100 |
commit | c16b2a3a8624ed908e1aa5bffc339c299f3ef13f (patch) | |
tree | 51d6b4ad93f3fdf26feb9a71f74e9c4c9ecea431 | |
parent | e952dbe17a40ef96bcbd4b8a8f02972e4a097b14 (diff) | |
download | scintilla-mirror-c16b2a3a8624ed908e1aa5bffc339c299f3ef13f.tar.gz |
Wrap lines if needed when moving to a position. Bug #3487397.
From Marko Njezic.
-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; |