mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-24 13:21:22 +08:00
Merge remote-tracking branch 'origin/GP-1-dragonmacher-text-search-annotation-fix--SQUASHED'
This commit is contained in:
+12
-13
@@ -243,21 +243,20 @@ public class SearchTextPlugin extends ProgramPlugin implements OptionsChangeList
|
||||
}
|
||||
|
||||
void next() {
|
||||
Program program = navigatable.getProgram();
|
||||
ProgramLocation location = getStartLocation();
|
||||
Searcher textSearcher = null;
|
||||
SearchOptions searchOptions = searchDialog.getSearchOptions();
|
||||
AddressSetView addressSet = getAddressSet(navigatable, searchOptions);
|
||||
|
||||
if (searchOptions.isProgramDatabaseSearch()) {
|
||||
textSearcher = new ProgramDatabaseSearcher(tool, program, location, addressSet,
|
||||
searchOptions,
|
||||
searchDialog.showTaskMonitorComponent(AbstractSearchTableModel.TITLE, true, true));
|
||||
ProgramLocation loc = getStartLocation();
|
||||
Searcher textSearcher = null;
|
||||
SearchOptions options = searchDialog.getSearchOptions();
|
||||
AddressSetView addrs = getAddressSet(navigatable, options);
|
||||
|
||||
TaskMonitor monitor =
|
||||
searchDialog.showTaskMonitorComponent(AbstractSearchTableModel.TITLE, true, true);
|
||||
Program program = navigatable.getProgram();
|
||||
if (options.isProgramDatabaseSearch()) {
|
||||
textSearcher = new ProgramDatabaseSearcher(tool, program, loc, addrs, options, monitor);
|
||||
}
|
||||
else {
|
||||
textSearcher = new ListingDisplaySearcher(tool, program, location, addressSet,
|
||||
searchDialog.getSearchOptions(),
|
||||
searchDialog.showTaskMonitorComponent(AbstractSearchTableModel.TITLE, true, true));
|
||||
textSearcher = new ListingDisplaySearcher(tool, program, loc, addrs, options, monitor);
|
||||
}
|
||||
searchNext(navigatable.getProgram(), navigatable, textSearcher);
|
||||
}
|
||||
@@ -387,7 +386,7 @@ public class SearchTextPlugin extends ProgramPlugin implements OptionsChangeList
|
||||
.description(DESCRIPTION)
|
||||
.helpLocation(new HelpLocation(HelpTopics.SEARCH, "Search Text"))
|
||||
.withContext(NavigatableActionContext.class, true)
|
||||
.validContextWhen(c -> !(c instanceof RestrictedAddressSetContext))
|
||||
.validWhen(c -> !(c instanceof RestrictedAddressSetContext))
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.onAction(c -> {
|
||||
setNavigatable(c.getNavigatable());
|
||||
|
||||
+2
-2
@@ -108,14 +108,14 @@ final public class AnnotatedTextFieldElement extends AbstractTextFieldElement {
|
||||
|
||||
@Override
|
||||
public RowColLocation getDataLocationForCharacterIndex(int characterIndex) {
|
||||
return new RowColLocation(row, column);
|
||||
return new RowColLocation(row, column + characterIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCharacterIndexForDataLocation(int dataRow, int dataColumn) {
|
||||
if (row == dataRow) {
|
||||
if (dataColumn >= column && dataColumn < column + attributedString.length()) {
|
||||
return 0;
|
||||
return dataColumn - column;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user