Update post-search tracking column for future caret offline movement

Fix #8670, close #8676
This commit is contained in:
Scott Sumner 2020-08-06 16:45:13 -04:00 committed by Don HO
parent 33f042932f
commit e0f0dc14da
1 changed files with 5 additions and 0 deletions

View File

@ -226,6 +226,11 @@ void Searching::displaySectionCentered(int posStart, int posEnd, ScintillaEditVi
// Move cursor to end of result and select result // Move cursor to end of result and select result
pEditView->execute(SCI_GOTOPOS, posEnd); pEditView->execute(SCI_GOTOPOS, posEnd);
pEditView->execute(SCI_SETANCHOR, posStart); pEditView->execute(SCI_SETANCHOR, posStart);
// Update Scintilla's knowledge about what column the caret is in, so that if user
// does up/down arrow as first navigation after the search result is selected,
// the caret doesn't jump to an unexpected column
pEditView->execute(SCI_CHOOSECARETX);
} }
LONG_PTR FindReplaceDlg::originalFinderProc = NULL; LONG_PTR FindReplaceDlg::originalFinderProc = NULL;