summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2020-03-05 19:00:43 -0500
committerJiayi Zhao <jeff.no.zhao@gmail.com>2020-03-05 19:00:43 -0500
commitc6b559736b9095255e7c3caaa5b0d98085b5e7d6 (patch)
tree62fc0fc334c748c98b916da10653e96bf3ebe0ba /src
parenta1b4e12eb5d81919a0db2f7107b915ab1cc40d50 (diff)
fix cursor moving to the top when a reload happens
Diffstat (limited to 'src')
-rw-r--r--src/fs/dirlist.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fs/dirlist.rs b/src/fs/dirlist.rs
index e3462b2..0621ee1 100644
--- a/src/fs/dirlist.rs
+++ b/src/fs/dirlist.rs
@@ -76,7 +76,7 @@ impl JoshutoDirList {
.enumerate()
.find(|(_, e)| e.file_name() == entry.file_name())
.and_then(|(i, _)| Some(i))
- .or(Some(0))
+ .or(Some(contents_len - 1))
}
None => Some(0),
}