Skip to content

Commit

Permalink
Fix tab complete tooltip reading in old versions
Browse files Browse the repository at this point in the history
Fixes #648
  • Loading branch information
kennytv committed Dec 11, 2023
1 parent b09950d commit e020dd6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,7 @@ public void register() {
for (int i = 0; i < count; i++) {
String match = wrapper.read(Type.STRING);
wrapper.write(Type.STRING, (start == 0 && !storage.isLastAssumeCommand() ? "/" : "") + match);
// Ignore tooltip
if (wrapper.read(Type.BOOLEAN)) {
wrapper.read(Type.STRING);
}
wrapper.read(Type.OPTIONAL_COMPONENT); // Remove tooltip
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,7 @@ public void register() {
int count = wrapper.get(Type.VAR_INT, 3);
for (int i = 0; i < count; i++) {
wrapper.passthrough(Type.STRING);
boolean hasTooltip = wrapper.passthrough(Type.BOOLEAN);
if (hasTooltip) {
wrapper.passthrough(Type.STRING); // JSON Tooltip
}
wrapper.passthrough(Type.OPTIONAL_COMPONENT); // Tooltip
}
});
}
Expand Down

0 comments on commit e020dd6

Please sign in to comment.