mirror of
https://github.com/sayanarijit/xplr.git
synced 2024-09-11 19:07:47 +03:00
Compare commits
No commits in common. "976530ba708abd7038de4fd113b3ec1c8bec9d6f" and "1600ad9a9c2119490c286c4bfeef6ec8e99112a7" have entirely different histories.
976530ba70
...
1600ad9a9c
@ -42,12 +42,6 @@ Set it to `true` if you want to hide all remaps in the help menu.
|
||||
|
||||
Type: boolean
|
||||
|
||||
#### xplr.config.general.vimlike_scrolling
|
||||
|
||||
Set it to `true` if you want vim-like scrolling.
|
||||
|
||||
Type: boolean
|
||||
|
||||
#### xplr.config.general.enforce_bounded_index_navigation
|
||||
|
||||
Set it to `true` if you want the cursor to stay in the same position when
|
||||
|
@ -915,7 +915,8 @@ impl App {
|
||||
dir.scroll_state.set_focus(0);
|
||||
}
|
||||
} else {
|
||||
dir.scroll_state.set_focus(dir.scroll_state.get_focus() + 1);
|
||||
dir.scroll_state
|
||||
.set_focus(dir.scroll_state.get_focus() + 1);
|
||||
}
|
||||
};
|
||||
Ok(self)
|
||||
|
@ -12,6 +12,7 @@ pub struct ScrollState {
|
||||
}
|
||||
|
||||
impl ScrollState {
|
||||
|
||||
pub fn set_focus(&mut self, current_focus: usize) {
|
||||
self.last_focus = Some(self.current_focus);
|
||||
self.current_focus = current_focus;
|
||||
@ -47,9 +48,9 @@ impl ScrollState {
|
||||
.saturating_sub(preview_cushion + 1)
|
||||
.min(total.saturating_sub(preview_cushion + 1));
|
||||
|
||||
if !vimlike_scrolling {
|
||||
let new_skipped_rows = if !vimlike_scrolling {
|
||||
height * (self.current_focus / height.max(1))
|
||||
} else if last_focus.is_none() {
|
||||
} else if last_focus == None {
|
||||
// Just entered the directory
|
||||
0
|
||||
} else if current_focus == 0 {
|
||||
@ -85,7 +86,9 @@ impl ScrollState {
|
||||
} else {
|
||||
// If nothing matches; do nothing
|
||||
first_visible_row
|
||||
}
|
||||
};
|
||||
|
||||
new_skipped_rows
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user