Skip to content

Commit

Permalink
feat: maintain curosr position when reset directory
Browse files Browse the repository at this point in the history
  • Loading branch information
anmitsu committed Nov 15, 2021
1 parent 7067815 commit f73b7b1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions filer/directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,11 @@ func (d *Directory) Reset() {
if d.IsMark() {
d.MarkClear()
} else if _, ok := d.reader.(defaultReader); !ok {
name := d.File().Name()
d.reader = defaultReader(".")
d.read()
d.SetCursorByName(name)
d.SetOffsetCenteredCursor()
}
}

Expand Down

0 comments on commit f73b7b1

Please sign in to comment.