aboutsummaryrefslogtreecommitdiff
path: root/alacritty
diff options
context:
space:
mode:
Diffstat (limited to 'alacritty')
-rw-r--r--alacritty/src/config/mod.rs9
-rw-r--r--alacritty/src/input.rs17
-rw-r--r--alacritty/src/logging.rs3
3 files changed, 20 insertions, 9 deletions
diff --git a/alacritty/src/config/mod.rs b/alacritty/src/config/mod.rs
index 8b881fca..beaffd87 100644
--- a/alacritty/src/config/mod.rs
+++ b/alacritty/src/config/mod.rs
@@ -202,6 +202,15 @@ fn print_deprecation_warnings(config: &Config) {
"Config persistent_logging is deprecated; please use debug.persistent_logging instead"
);
}
+
+ if config.scrolling.faux_multiplier().is_some() {
+ warn!(
+ target: LOG_TARGET_CONFIG,
+ "Config scrolling.faux_multiplier is deprecated; the alternate scroll escape can now \
+ be used to disable it and `scrolling.multiplier` controls the number of scrolled \
+ lines"
+ );
+ }
}
#[cfg(test)]
diff --git a/alacritty/src/input.rs b/alacritty/src/input.rs
index be6a030e..a3148820 100644
--- a/alacritty/src/input.rs
+++ b/alacritty/src/input.rs
@@ -551,11 +551,9 @@ impl<'a, T: EventListener, A: ActionContext<T> + 'a> Processor<'a, T, A> {
fn scroll_terminal(&mut self, modifiers: ModifiersState, new_scroll_px: i32) {
let mouse_modes =
TermMode::MOUSE_REPORT_CLICK | TermMode::MOUSE_DRAG | TermMode::MOUSE_MOTION;
+ let alt_scroll_modes = TermMode::ALT_SCREEN | TermMode::ALTERNATE_SCROLL;
let height = self.ctx.size_info().cell_height as i32;
- // Make sure the new and deprecated setting are both allowed
- let faux_multiplier = self.config.scrolling.faux_multiplier() as usize;
-
if self.ctx.terminal().mode().intersects(mouse_modes) {
self.ctx.mouse_mut().scroll_px += new_scroll_px;
@@ -565,11 +563,14 @@ impl<'a, T: EventListener, A: ActionContext<T> + 'a> Processor<'a, T, A> {
for _ in 0..lines {
self.mouse_report(code, ElementState::Pressed, modifiers);
}
- } else if self.ctx.terminal().mode().contains(TermMode::ALT_SCREEN)
- && faux_multiplier > 0
- && !modifiers.shift
- {
- self.ctx.mouse_mut().scroll_px += new_scroll_px * faux_multiplier as i32;
+ } else if self.ctx.terminal().mode().contains(alt_scroll_modes) && !modifiers.shift {
+ let multiplier = i32::from(
+ self.config
+ .scrolling
+ .faux_multiplier()
+ .unwrap_or_else(|| self.config.scrolling.multiplier()),
+ );
+ self.ctx.mouse_mut().scroll_px += new_scroll_px * multiplier;
let cmd = if new_scroll_px > 0 { b'A' } else { b'B' };
let lines = (self.ctx.mouse().scroll_px / height).abs();
diff --git a/alacritty/src/logging.rs b/alacritty/src/logging.rs
index ea44637b..9d837a78 100644
--- a/alacritty/src/logging.rs
+++ b/alacritty/src/logging.rs
@@ -172,7 +172,8 @@ impl OnDemandLogFile {
Ok(file) => {
self.file = Some(io::LineWriter::new(file));
self.created.store(true, Ordering::Relaxed);
- let _ = writeln!(io::stdout(), "Created log file at \"{}\"", self.path.display());
+ let _ =
+ writeln!(io::stdout(), "Created log file at \"{}\"", self.path.display());
},
Err(e) => {
let _ = writeln!(io::stdout(), "Unable to create log file: {}", e);