mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
feature: make backward content visible when moving cursor back in input field
This commit is contained in:
parent
f1cf136df4
commit
574ee27993
1 changed files with 2 additions and 2 deletions
|
|
@ -39,8 +39,8 @@ impl Input {
|
||||||
));
|
));
|
||||||
|
|
||||||
let (limit, snap) = (self.limit(), self.snap_mut());
|
let (limit, snap) = (self.limit(), self.snap_mut());
|
||||||
if snap.offset > snap.cursor {
|
if snap.offset + limit / 2 > snap.cursor {
|
||||||
snap.offset = snap.cursor;
|
snap.offset = snap.cursor.saturating_sub(limit / 2);
|
||||||
} else if snap.value.is_empty() {
|
} else if snap.value.is_empty() {
|
||||||
snap.offset = 0;
|
snap.offset = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue