Skip to content

Commit

Permalink
fix(gui): improve highlight in UsageDialog (#2006)(PR #2007)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesaryuan authored Sep 15, 2023
1 parent cdede7e commit b78a025
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ private void updateTitle(String searchText) {
}
}

public void updateHighlightContext(String text, boolean caseSensitive, boolean regexp) {
public void updateHighlightContext(String text, boolean caseSensitive, boolean regexp, boolean wholeWord) {
updateTitle(text);
highlightContext = new SearchContext(text);
highlightContext.setMatchCase(caseSensitive);
highlightContext.setWholeWord(wholeWord);
highlightContext.setRegularExpression(regexp);
highlightContext.setMarkAll(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ private void updateTable() {

private void updateTableHighlight() {
String text = searchField.getText();
updateHighlightContext(text, !options.contains(IGNORE_CASE), options.contains(USE_REGEX));
updateHighlightContext(text, !options.contains(IGNORE_CASE), options.contains(USE_REGEX), false);
cache.setLastSearch(text);
cache.getLastSearchOptions().put(searchPreset, options);
if (!mainWindow.getSettings().isUseAutoSearch()) {
Expand Down
2 changes: 1 addition & 1 deletion jadx-gui/src/main/java/jadx/gui/ui/dialog/UsageDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ protected void loadFinished() {

Collections.sort(usageList);
resultsModel.addAll(usageList);
updateHighlightContext(node.getName(), true, false);
updateHighlightContext(node.getName(), true, false, true);
resultsTable.initColumnWidth();
resultsTable.updateTable();
updateProgressLabel(true);
Expand Down

0 comments on commit b78a025

Please sign in to comment.