aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2018-02-16 17:54:32 -0800
committerJoe Wilm <joe@jwilm.com>2018-06-02 09:32:29 -0700
commitc49a7e88f64d1421474d492cc6f51bfd30e1e4d1 (patch)
tree970237ddc0a0f1702c417b2f072cd70a0e9c228a /src/config.rs
parent7fe67743ebffd047532f6271bf28474f9d947f64 (diff)
downloadalacritty-c49a7e88f64d1421474d492cc6f51bfd30e1e4d1.tar.gz
alacritty-c49a7e88f64d1421474d492cc6f51bfd30e1e4d1.zip
Make number of scrollback lines configurable
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index 40c550b0..b0523c13 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -396,6 +396,14 @@ pub struct Config {
/// Number of spaces in one tab
#[serde(default="default_tabspaces", deserialize_with = "deserialize_tabspaces")]
tabspaces: usize,
+
+ /// How much scrolling history to keep
+ #[serde(default="default_scroll_history")]
+ scroll_history: u32,
+}
+
+fn default_scroll_history() -> u32 {
+ 10_000
}
fn failure_default_vec<'a, D, T>(deserializer: D) -> ::std::result::Result<Vec<T>, D::Error>
@@ -1244,6 +1252,10 @@ impl Config {
.map(|path| path.into())
}
+ pub fn scroll_history(&self) -> usize {
+ self.scroll_history as _
+ }
+
pub fn write_defaults() -> io::Result<Cow<'static, Path>> {
let path = ::xdg::BaseDirectories::with_prefix("alacritty")
.map_err(|err| io::Error::new(io::ErrorKind::NotFound, ::std::error::Error::description(&err)))