| @@ -22,7 +22,10 @@ use ratatui_image::picker::ProtocolType; |
| 22 | use serde::{Deserialize, Deserializer, Serialize, de::Error as SerdeError, de::Visitor}; |
22 | use serde::{Deserialize, Deserializer, Serialize, de::Error as SerdeError, de::Visitor}; |
| 23 | use url::Url; |
23 | use url::Url; |
| 24 | |
24 | |
| 25 | use modalkit::{env::vim::VimMode, key::TerminalKey, keybindings::InputKey}; |
25 | use modalkit::env::vim::VimMode; |
| |
26 | use modalkit::key::TerminalKey; |
| |
27 | use modalkit::keybindings::InputKey; |
| |
28 | use modalkit::prelude::Axis; |
| 26 | |
29 | |
| 27 | use super::base::{ |
30 | use super::base::{ |
| 28 | IambError, |
31 | IambError, |
| @@ -463,6 +466,15 @@ pub enum SplitDirection { |
| 463 | Vertical, |
466 | Vertical, |
| 464 | } |
467 | } |
| 465 | |
468 | |
| |
469 | impl SplitDirection { |
| |
470 | pub fn to_axis(self) -> Axis { |
| |
471 | match self { |
| |
472 | Self::Horizontal => Axis::Horizontal, |
| |
473 | Self::Vertical => Axis::Vertical, |
| |
474 | } |
| |
475 | } |
| |
476 | } |
| |
477 | |
| 466 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
478 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
| 467 | pub struct NotifyVia { |
479 | pub struct NotifyVia { |
| 468 | /// Deliver notifications via terminal bell. |
480 | /// Deliver notifications via terminal bell. |
| @@ -818,6 +830,7 @@ pub struct TunableValues { |
| 818 | pub user_gutter_width: usize, |
830 | pub user_gutter_width: usize, |
| 819 | pub external_edit_file_suffix: String, |
831 | pub external_edit_file_suffix: String, |
| 820 | pub tabstop: usize, |
832 | pub tabstop: usize, |
| |
833 | pub members_split: Option<SplitDirection>, |
| 821 | pub default_split: SplitDirection, |
834 | pub default_split: SplitDirection, |
| 822 | pub ssl_verify: bool, |
835 | pub ssl_verify: bool, |
| 823 | } |
836 | } |
| @@ -865,6 +878,7 @@ pub struct Tunables { |
| 865 | pub user_gutter_width: Option<usize>, |
878 | pub user_gutter_width: Option<usize>, |
| 866 | pub external_edit_file_suffix: Option<String>, |
879 | pub external_edit_file_suffix: Option<String>, |
| 867 | pub tabstop: Option<usize>, |
880 | pub tabstop: Option<usize>, |
| |
881 | pub members_split: Option<SplitDirection>, |
| 868 | pub default_split: Option<SplitDirection>, |
882 | pub default_split: Option<SplitDirection>, |
| 869 | pub ssl_verify: Option<bool>, |
883 | pub ssl_verify: Option<bool>, |
| 870 | } |
884 | } |
| @@ -911,6 +925,7 @@ impl Tunables { |
| 911 | .external_edit_file_suffix |
925 | .external_edit_file_suffix |
| 912 | .or(other.external_edit_file_suffix), |
926 | .or(other.external_edit_file_suffix), |
| 913 | tabstop: self.tabstop.or(other.tabstop), |
927 | tabstop: self.tabstop.or(other.tabstop), |
| |
928 | members_split: self.members_split.or(other.members_split), |
| 914 | default_split: self.default_split.or(other.default_split), |
929 | default_split: self.default_split.or(other.default_split), |
| 915 | ssl_verify: self.ssl_verify.or(other.ssl_verify), |
930 | ssl_verify: self.ssl_verify.or(other.ssl_verify), |
| 916 | } |
931 | } |
| @@ -949,6 +964,7 @@ impl Tunables { |
| 949 | .external_edit_file_suffix |
964 | .external_edit_file_suffix |
| 950 | .unwrap_or_else(|| ".md".to_string()), |
965 | .unwrap_or_else(|| ".md".to_string()), |
| 951 | tabstop: self.tabstop.unwrap_or(4), |
966 | tabstop: self.tabstop.unwrap_or(4), |
| |
967 | members_split: self.members_split, |
| 952 | default_split: self.default_split.unwrap_or_default(), |
968 | default_split: self.default_split.unwrap_or_default(), |
| 953 | ssl_verify: self.ssl_verify.unwrap_or(true), |
969 | ssl_verify: self.ssl_verify.unwrap_or(true), |
| 954 | } |
970 | } |