Commit 41345fa4e6
Unregistered key
Layout: unified · split
config.example.toml +1
| @@ -11,6 +11,7 @@ default_room = "#iamb-users:0x.badd.cafe" | |||
| 11 | default_split = "vertical" | 11 | default_split = "vertical" |
| 12 | external_edit_file_suffix = ".md" | 12 | external_edit_file_suffix = ".md" |
| 13 | ignorecase = false | 13 | ignorecase = false |
| 14 | input_prompt = "❯ " | ||
| 14 | log_level = "warn" | 15 | log_level = "warn" |
| 15 | members_split = "vertical" | 16 | members_split = "vertical" |
| 16 | message_shortcode_display = false | 17 | message_shortcode_display = false |
docs/iamb.5 +2
| @@ -166,6 +166,8 @@ Subsection for configuring image previews. See | |||
| 166 | for more details. | 166 | for more details. |
| 167 | .It Sy ignorecase | 167 | .It Sy ignorecase |
| 168 | Defines whether searches ignore case. Defaults to false. | 168 | Defines whether searches ignore case. Defaults to false. |
| 169 | .It Sy input_prompt | ||
| 170 | Override the default message bar prompt. | ||
| 169 | .It Sy log_level | 171 | .It Sy log_level |
| 170 | Specifies the lowest log level that should be shown. | 172 | Specifies the lowest log level that should be shown. |
| 171 | Possible values are: | 173 | Possible values are: |
src/config.rs +4
| @@ -832,6 +832,7 @@ pub struct TunableValues { | |||
| 832 | pub user_gutter_width: usize, | 832 | pub user_gutter_width: usize, |
| 833 | pub external_edit_file_suffix: String, | 833 | pub external_edit_file_suffix: String, |
| 834 | pub tabstop: usize, | 834 | pub tabstop: usize, |
| 835 | pub input_prompt: Option<String>, | ||
| 835 | pub members_split: Option<SplitDirection>, | 836 | pub members_split: Option<SplitDirection>, |
| 836 | pub default_split: SplitDirection, | 837 | pub default_split: SplitDirection, |
| 837 | pub ssl_verify: bool, | 838 | pub ssl_verify: bool, |
| @@ -883,6 +884,7 @@ pub struct Tunables { | |||
| 883 | pub user_gutter_width: Option<usize>, | 884 | pub user_gutter_width: Option<usize>, |
| 884 | pub external_edit_file_suffix: Option<String>, | 885 | pub external_edit_file_suffix: Option<String>, |
| 885 | pub tabstop: Option<usize>, | 886 | pub tabstop: Option<usize>, |
| 887 | pub input_prompt: Option<String>, | ||
| 886 | pub members_split: Option<SplitDirection>, | 888 | pub members_split: Option<SplitDirection>, |
| 887 | pub default_split: Option<SplitDirection>, | 889 | pub default_split: Option<SplitDirection>, |
| 888 | pub ssl_verify: Option<bool>, | 890 | pub ssl_verify: Option<bool>, |
| @@ -933,6 +935,7 @@ impl Tunables { | |||
| 933 | .external_edit_file_suffix | 935 | .external_edit_file_suffix |
| 934 | .or(other.external_edit_file_suffix), | 936 | .or(other.external_edit_file_suffix), |
| 935 | tabstop: self.tabstop.or(other.tabstop), | 937 | tabstop: self.tabstop.or(other.tabstop), |
| 938 | input_prompt: self.input_prompt.or(other.input_prompt), | ||
| 936 | members_split: self.members_split.or(other.members_split), | 939 | members_split: self.members_split.or(other.members_split), |
| 937 | default_split: self.default_split.or(other.default_split), | 940 | default_split: self.default_split.or(other.default_split), |
| 938 | ssl_verify: self.ssl_verify.or(other.ssl_verify), | 941 | ssl_verify: self.ssl_verify.or(other.ssl_verify), |
| @@ -975,6 +978,7 @@ impl Tunables { | |||
| 975 | .external_edit_file_suffix | 978 | .external_edit_file_suffix |
| 976 | .unwrap_or_else(|| ".md".to_string()), | 979 | .unwrap_or_else(|| ".md".to_string()), |
| 977 | tabstop: self.tabstop.unwrap_or(4), | 980 | tabstop: self.tabstop.unwrap_or(4), |
| 981 | input_prompt: self.input_prompt, | ||
| 978 | members_split: self.members_split, | 982 | members_split: self.members_split, |
| 979 | default_split: self.default_split.unwrap_or_default(), | 983 | default_split: self.default_split.unwrap_or_default(), |
| 980 | ssl_verify: self.ssl_verify.unwrap_or(true), | 984 | ssl_verify: self.ssl_verify.unwrap_or(true), |
src/tests.rs +1
| @@ -170,6 +170,7 @@ pub fn mock_tunables() -> TunableValues { | |||
| 170 | ignorecase: false, | 170 | ignorecase: false, |
| 171 | default_room: None, | 171 | default_room: None, |
| 172 | encryption: Encryption::default().values(), | 172 | encryption: Encryption::default().values(), |
| 173 | input_prompt: None, | ||
| 173 | log_level: "warn".into(), | 174 | log_level: "warn".into(), |
| 174 | max_log_files: 7, | 175 | max_log_files: 7, |
| 175 | message_shortcode_display: false, | 176 | message_shortcode_display: false, |
src/windows/room/chat.rs +6 −4
| @@ -1177,10 +1177,12 @@ impl StatefulWidget for Chat<'_> { | |||
| 1177 | let encryption_settings = &settings.tunables.encryption; | 1177 | let encryption_settings = &settings.tunables.encryption; |
| 1178 | let encryption_indicator = encryption_settings | 1178 | let encryption_indicator = encryption_settings |
| 1179 | .get_indicator(EncryptionIndicatorLocation::PROMPT, state.room().encryption_state()); | 1179 | .get_indicator(EncryptionIndicatorLocation::PROMPT, state.room().encryption_state()); |
| 1180 | let prompt = match (self.focused, encryption_indicator) { | 1180 | let input_prompt = settings.tunables.input_prompt.as_deref(); |
| 1181 | (false, _) => Span::raw(" "), | 1181 | let prompt = match (self.focused, encryption_indicator, input_prompt) { |
| 1182 | (true, Some(i)) => i, | 1182 | (false, _, _) => Span::raw(" "), |
| 1183 | (true, None) => Span::raw("> "), | 1183 | (true, Some(i), _) => i, |
| 1184 | (true, None, None) => Span::raw("> "), | ||
| 1185 | (true, None, Some(s)) => Span::raw(s), | ||
| 1184 | }; | 1186 | }; |
| 1185 | 1187 | ||
| 1186 | let tbox = TextBox::new().prompt(prompt); | 1188 | let tbox = TextBox::new().prompt(prompt); |