empty check should not be ignored

This commit is contained in:
Xerxes-2 2024-06-28 12:02:19 +10:00
parent 5ba632b6f9
commit 8f414a4c6b
No known key found for this signature in database
GPG key ID: A6C508165D76B601

View file

@ -43,6 +43,8 @@ impl Input {
snap.cursor.saturating_sub(limit / 2).min(snap.len().saturating_sub(limit.saturating_sub(1)));
if snap.offset != offset {
snap.offset = offset;
} else if snap.value.is_empty() {
snap.offset = 0;
} else {
let delta = snap.mode.delta();
let s = snap.slice(snap.offset..snap.cursor + delta);