Restore reading backspace if typing with autoread disabled.
This commit is contained in:
1 parent
eaf450587c
commit
57799cd2eb
6 files changed
+295
-6
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user