Restore reading backspace if typing with autoread disabled.

This commit is contained in:
Storm Dragon committed 2026-10-28 01:14:09 -04:00
1 parent eaf450587c
commit 57799cd2eb
6 files changed
+295 -6

No files matched your search

+19
View File
@@ -138,3 +138,22 @@ func all_spaces(cells []rune) bool {
}
return true
}
// Deletion echo uses only text verified against the previous screen. Like
// typing echo, it remains available with autoread/cursor/character echo off,
// but never exposes text excluded by a live region.
func (r *Reader) deletion_echo(deleted []rune, next screen.Snapshot) []presentation.Message {
var allowed []rune
for index, char := range deleted {
if r.region_state().allows(next.X+index, next.Y, next.Cols, false, true) {
allowed = append(allowed, char)
}
}
if len(allowed) == 1 {
return []presentation.Message{presentation.Character_message(allowed[0])}
}
if len(allowed) > 1 {
return []presentation.Message{{Text: string(allowed)}}
}
return nil
}