diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-03-05 19:00:43 -0500 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-03-05 19:00:43 -0500 |
commit | c6b559736b9095255e7c3caaa5b0d98085b5e7d6 (patch) | |
tree | 62fc0fc334c748c98b916da10653e96bf3ebe0ba /src | |
parent | a1b4e12eb5d81919a0db2f7107b915ab1cc40d50 (diff) |
fix cursor moving to the top when a reload happens
Diffstat (limited to 'src')
-rw-r--r-- | src/fs/dirlist.rs | 2 |
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), } |