Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-08 17:20:24 +01:00
Fix tab completion not completing mid-word, also makes code simpler
Dieser Commit ist enthalten in:
Ursprung
f90029319e
Commit
246dc34835
@ -67,15 +67,10 @@ public class ProtocolSnapshotTo1_12_2 extends Protocol {
|
|||||||
index = input.length();
|
index = input.length();
|
||||||
length = 0;
|
length = 0;
|
||||||
} else {
|
} else {
|
||||||
// Otherwise find the last space
|
// Otherwise find the last space (+1 as we include it)
|
||||||
int lastSpace = input.lastIndexOf(" ");
|
int lastSpace = input.lastIndexOf(" ") + 1;
|
||||||
if (lastSpace == -1) {
|
index = lastSpace;
|
||||||
index = 0;
|
length = input.length() - lastSpace;
|
||||||
length = input.length();
|
|
||||||
} else {
|
|
||||||
index = lastSpace;
|
|
||||||
length = input.length() - lastSpace;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Write index + length
|
// Write index + length
|
||||||
wrapper.write(Type.VAR_INT, index);
|
wrapper.write(Type.VAR_INT, index);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren