Skip to content

Commit

Permalink
Merge pull request #95 from dzmipt/finosSearchBugs
Browse files Browse the repository at this point in the history
Select find text (issue #91) and Fix Find Back (issue #93)
  • Loading branch information
punx120 authored Mar 23, 2022
2 parents 3a18cb6 + 611f3fe commit 3f8f64e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/studio/ui/SearchPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public void setReplaceVisible(boolean visible) {
public void setVisible(boolean visible) {
super.setVisible(visible);
if (visible) {
txtFind.selectAll();
txtFind.requestFocus();
}
}
Expand Down Expand Up @@ -139,7 +140,7 @@ private void doSearch(SearchContext context, SearchAction action) {
}
}

int pos = textArea.getCaretPosition();
int pos = context.getSearchForward() ? textArea.getSelectionEnd() : textArea.getSelectionStart();
textArea.setSelectionStart(pos);
textArea.setSelectionEnd(pos);
SearchResult result;
Expand Down

0 comments on commit 3f8f64e

Please sign in to comment.