fix prediction: confirm space characters instead of stalling

This commit is contained in:
realrasengan
2026-04-01 18:22:18 -07:00
parent f058c421e7
commit 8e597f7e5d
2 changed files with 28 additions and 1 deletions
+2 -1
View File
@@ -149,8 +149,9 @@ func (p *Predictor) Confirm(fb *Framebuffer) {
if cell.Rune == pred.r {
// Server confirmed this prediction.
confirmed++
} else if cell.Rune == ' ' || cell.Rune == 0 {
} else if (cell.Rune == ' ' || cell.Rune == 0) && pred.r != ' ' {
// Server hasn't caught up yet — stop checking.
// (But if we predicted a space, a space cell is a match, handled above.)
break
} else {
// Server diverged — something unexpected happened