mirror of
https://github.com/fadden/6502bench.git
synced 2025-02-07 14:31:00 +00:00
Add current position to nav stack on initial Find
It's fairly common to want to Find something and then jump back to where you were. The Find command now adds the current position to the nav stack for the initial search. If you Find Next, the nav stack is not altered.
This commit is contained in:
parent
94d7a30a09
commit
0b765e075f
@ -2466,19 +2466,19 @@ namespace SourceGen {
|
||||
if (dlg.ShowDialog() == true) {
|
||||
mFindString = dlg.TextToFind;
|
||||
mFindStartIndex = -1;
|
||||
FindText(dlg.IsBackward);
|
||||
FindText(dlg.IsBackward, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void FindNext() {
|
||||
FindText(false);
|
||||
FindText(false, false);
|
||||
}
|
||||
|
||||
public void FindPrevious() {
|
||||
FindText(true);
|
||||
FindText(true, false);
|
||||
}
|
||||
|
||||
private void FindText(bool goBackward) {
|
||||
private void FindText(bool goBackward, bool pushLocation) {
|
||||
if (string.IsNullOrEmpty(mFindString)) {
|
||||
return;
|
||||
}
|
||||
@ -2519,6 +2519,10 @@ namespace SourceGen {
|
||||
StringComparison.InvariantCultureIgnoreCase);
|
||||
if (matchPos >= 0) {
|
||||
//Debug.WriteLine("Match " + index + ": " + searchStr);
|
||||
if (pushLocation) {
|
||||
mNavStack.Push(GetCurrentlySelectedLocation());
|
||||
}
|
||||
|
||||
mMainWin.CodeListView_EnsureVisible(index);
|
||||
mMainWin.CodeListView_SelectRange(index, 1);
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user