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-03-07 09:47:21 -0800
commit5c648a34aabf9c9805eced4f3b5443310a4cd461 (patch)
tree1da7dfad203eb8dbc1952636745945be2a7b30e2 /src/config.rs
parent001b780dda549b08c170193ea81b9961edb20acf (diff)
downloadalacritty-5c648a34aabf9c9805eced4f3b5443310a4cd461.tar.gz
alacritty-5c648a34aabf9c9805eced4f3b5443310a4cd461.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 eb7f0f72..58f4b815 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)))