diff options
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index 7734e7af..0e241b51 100644 --- a/src/config.rs +++ b/src/config.rs @@ -171,6 +171,7 @@ impl<'a> Shell<'a> { } } + /// Top-level config type #[derive(Debug, Deserialize)] pub struct Config { @@ -202,6 +203,11 @@ pub struct Config { #[serde(default)] custom_cursor_colors: bool, + // TODO these should be optional + #[serde(deserialize_with="deserialize_duration_ms")] + cursor_blink_interval: Duration, + cursor_blink: bool, + /// Should draw bold text with brighter colors intead of bold font #[serde(default="true_bool")] draw_bold_text_with_bright_colors: bool, @@ -278,6 +284,8 @@ impl Default for Config { font: Default::default(), render_timer: Default::default(), custom_cursor_colors: false, + cursor_blink: true, + cursor_blink_interval: Duration::from_millis(300), colors: Default::default(), key_bindings: Vec::new(), mouse_bindings: Vec::new(), @@ -1142,6 +1150,14 @@ impl Config { Ok(contents) } + + pub fn cursor_blink_interval(&self) -> Duration { + self.cursor_blink_interval + } + + pub fn blink_enabled(&self) -> bool { + self.cursor_blink + } } /// Window Dimensions |