fix: reset scroll offset when preserveKey changes cursor to avoid hidden top entries on go-parent
This commit is contained in:
parent
152d45c7af
commit
d5569ecdd0
1 changed files with 4 additions and 0 deletions
|
|
@ -69,7 +69,11 @@ func (p *BrowserPane) SetEntries(entries []vfs.Entry, preserveKey string) {
|
|||
return
|
||||
}
|
||||
if preserveKey != "" {
|
||||
oldCursor := p.Cursor
|
||||
p.Cursor = vfs.FindSelected(entries, preserveKey)
|
||||
if p.Cursor != oldCursor {
|
||||
p.Offset = 0
|
||||
}
|
||||
}
|
||||
if p.Cursor >= len(entries) {
|
||||
p.Cursor = len(entries) - 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue