mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-18 13:55:23 -05:00
Fix linux config default value
This commit is contained in:
parent
c1e831dab0
commit
a741193bc0
3 changed files with 7 additions and 15 deletions
|
@ -40,7 +40,7 @@ scrolling:
|
|||
|
||||
# Number of lines the viewport will move for every line
|
||||
# scrolled when scrollback is enabled (history > 0).
|
||||
multiplier: 1
|
||||
multiplier: 3
|
||||
|
||||
# Faux Scrolling
|
||||
#
|
||||
|
|
|
@ -385,18 +385,6 @@ pub struct Config {
|
|||
scrolling: Scrolling,
|
||||
}
|
||||
|
||||
fn deserialize_scroll_history<'a, D>(deserializer: D) -> ::std::result::Result<u32, D::Error>
|
||||
where D: de::Deserializer<'a>
|
||||
{
|
||||
match u32::deserialize(deserializer) {
|
||||
Ok(lines) => Ok(lines),
|
||||
Err(err) => {
|
||||
eprintln!("problem with config: {}; Using default value", err);
|
||||
Ok(default_scroll_history())
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
fn failure_default_vec<'a, D, T>(deserializer: D) -> ::std::result::Result<Vec<T>, D::Error>
|
||||
where D: de::Deserializer<'a>,
|
||||
T: Deserialize<'a>
|
||||
|
|
|
@ -398,7 +398,7 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> {
|
|||
65
|
||||
};
|
||||
|
||||
let scrolling_multiplier = self.mouse_config.normal_scrolling_lines;
|
||||
let scrolling_multiplier = self.scrolling_config.multiplier;
|
||||
for _ in 0..(to_scroll.abs() as usize) {
|
||||
self.scroll_terminal(mouse_modes, code, modifiers, scrolling_multiplier)
|
||||
}
|
||||
|
@ -436,7 +436,11 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> {
|
|||
fn scroll_terminal(&mut self, mouse_modes: TermMode, code: u8, modifiers: ModifiersState, scroll_multiplier: u8) {
|
||||
debug_assert!(code == 64 || code == 65);
|
||||
|
||||
let faux_scrollback_lines = self.mouse_config.faux_scrollback_lines as usize;
|
||||
// Make sure the new and deprecated setting are both allowed
|
||||
let faux_scrollback_lines = self.mouse_config
|
||||
.faux_scrollback_lines
|
||||
.unwrap_or(self.scrolling_config.faux_multiplier as usize);
|
||||
|
||||
if self.ctx.terminal_mode().intersects(mouse_modes) {
|
||||
self.mouse_report(code, ElementState::Pressed);
|
||||
} else if self.ctx.terminal_mode().contains(TermMode::ALT_SCREEN)
|
||||
|
|
Loading…
Reference in a new issue