mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-06-01 06:55:01 +08:00
GT-3071: Fixing register highlight issue (fixes #810).
This commit is contained in:
+9
-2
@@ -215,12 +215,19 @@ public class ListingHighlightProvider
|
|||||||
|
|
||||||
List<String> registerNames = gatherRegisterNames(new ArrayList<String>(), register);
|
List<String> registerNames = gatherRegisterNames(new ArrayList<String>(), register);
|
||||||
|
|
||||||
StringBuilder buffy = new StringBuilder();
|
|
||||||
for (String s : highlightStrings) {
|
for (String s : highlightStrings) {
|
||||||
if (s != null) {
|
if (s != null) {
|
||||||
buffy.append("\\Q").append(s).append("\\E|");
|
registerNames.add(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prioritize exact register matches by ensuring that the longest register name gets
|
||||||
|
// matched first
|
||||||
|
Collections.sort(registerNames, (a, b) -> {
|
||||||
|
return Integer.valueOf(b.length()).compareTo(Integer.valueOf(a.length()));
|
||||||
|
});
|
||||||
|
|
||||||
|
StringBuilder buffy = new StringBuilder();
|
||||||
for (String name : registerNames) {
|
for (String name : registerNames) {
|
||||||
buffy.append("\\Q").append(name).append("\\E|");
|
buffy.append("\\Q").append(name).append("\\E|");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user