feat: configure cursor distance from viewport edges
This commit is contained in:
@@ -1762,6 +1762,7 @@ pub struct Editor {
|
||||
bottom_bar: ChromeLine,
|
||||
popup: PopupConfig,
|
||||
labels: BTreeMap<String, String>,
|
||||
scroll_distance: Option<usize>,
|
||||
battery_charge: Option<u8>,
|
||||
battery_label: String,
|
||||
git_blame: bool,
|
||||
@@ -1863,6 +1864,7 @@ impl Editor {
|
||||
bottom_bar: ChromeLine::bottom(),
|
||||
popup: PopupConfig::default(),
|
||||
labels: BTreeMap::new(),
|
||||
scroll_distance: Some(0),
|
||||
battery_charge: None,
|
||||
battery_label: String::new(),
|
||||
git_blame: true,
|
||||
@@ -2601,6 +2603,14 @@ impl Editor {
|
||||
.map_or(self.active.view.word_wrap, |diff| diff.word_wrap)
|
||||
}
|
||||
|
||||
pub fn scroll_distance(&self) -> Option<usize> {
|
||||
self.scroll_distance
|
||||
}
|
||||
|
||||
pub(crate) fn set_scroll_distance(&mut self, distance: Option<usize>) {
|
||||
self.scroll_distance = distance;
|
||||
}
|
||||
|
||||
pub(crate) fn set_diff_context_options(&mut self, context_lines: usize, expand_lines: usize) {
|
||||
self.diff_context_options = (context_lines, expand_lines);
|
||||
if let Some(diff) = &mut self.diff {
|
||||
|
||||
Reference in New Issue
Block a user