Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ default_room = "#iamb-users:0x.badd.cafe"
default_split = "vertical"
external_edit_file_suffix = ".md"
ignorecase = false
input_prompt = "❯ "
log_level = "warn"
members_split = "vertical"
message_shortcode_display = false
Expand Down
2 changes: 2 additions & 0 deletions docs/iamb.5
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ Subsection for configuring image previews. See
for more details.
.It Sy ignorecase
Defines whether searches ignore case. Defaults to false.
.It Sy input_prompt
Override the default message bar prompt.
.It Sy log_level
Specifies the lowest log level that should be shown.
Possible values are:
Expand Down
4 changes: 4 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@ pub struct TunableValues {
pub user_gutter_width: usize,
pub external_edit_file_suffix: String,
pub tabstop: usize,
pub input_prompt: Option<String>,
pub members_split: Option<SplitDirection>,
pub default_split: SplitDirection,
pub ssl_verify: bool,
Expand Down Expand Up @@ -883,6 +884,7 @@ pub struct Tunables {
pub user_gutter_width: Option<usize>,
pub external_edit_file_suffix: Option<String>,
pub tabstop: Option<usize>,
pub input_prompt: Option<String>,
pub members_split: Option<SplitDirection>,
pub default_split: Option<SplitDirection>,
pub ssl_verify: Option<bool>,
Expand Down Expand Up @@ -933,6 +935,7 @@ impl Tunables {
.external_edit_file_suffix
.or(other.external_edit_file_suffix),
tabstop: self.tabstop.or(other.tabstop),
input_prompt: self.input_prompt.or(other.input_prompt),
members_split: self.members_split.or(other.members_split),
default_split: self.default_split.or(other.default_split),
ssl_verify: self.ssl_verify.or(other.ssl_verify),
Expand Down Expand Up @@ -975,6 +978,7 @@ impl Tunables {
.external_edit_file_suffix
.unwrap_or_else(|| ".md".to_string()),
tabstop: self.tabstop.unwrap_or(4),
input_prompt: self.input_prompt,
members_split: self.members_split,
default_split: self.default_split.unwrap_or_default(),
ssl_verify: self.ssl_verify.unwrap_or(true),
Expand Down
1 change: 1 addition & 0 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ pub fn mock_tunables() -> TunableValues {
ignorecase: false,
default_room: None,
encryption: Encryption::default().values(),
input_prompt: None,
log_level: "warn".into(),
max_log_files: 7,
message_shortcode_display: false,
Expand Down
10 changes: 6 additions & 4 deletions src/windows/room/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1177,10 +1177,12 @@ impl StatefulWidget for Chat<'_> {
let encryption_settings = &settings.tunables.encryption;
let encryption_indicator = encryption_settings
.get_indicator(EncryptionIndicatorLocation::PROMPT, state.room().encryption_state());
let prompt = match (self.focused, encryption_indicator) {
(false, _) => Span::raw(" "),
(true, Some(i)) => i,
(true, None) => Span::raw("> "),
let input_prompt = settings.tunables.input_prompt.as_deref();
let prompt = match (self.focused, encryption_indicator, input_prompt) {
(false, _, _) => Span::raw(" "),
(true, Some(i), _) => i,
(true, None, None) => Span::raw("> "),
(true, None, Some(s)) => Span::raw(s),
};

let tbox = TextBox::new().prompt(prompt);
Expand Down
Loading