Commit 0ff8828a1c

0ff8828a1c6dd944edcaa68bdab859e89d626e6b

parent: 331a6bca89

Unregistered key

vaw <git@nlih.de> · 2025-07-23 04:05 UTC
committer: <noreply@github.com>

Add config option to allow resetting mode after sending a message (#459)

Co-authored-by: Ulyssa <git@ulyssa.dev>

Layout: unified · split

docs/iamb.5 +3
@@ -173,6 +173,9 @@ respective shortcodes.
173173.It Sy message_user_color
174174Defines whether or not the message body is colored like the username.
175175
176.It Sy normal_after_send
177Defines whether to reset input to Normal mode after sending a message.
178
176179.It Sy notifications
177180When this subsection is present, you can enable and configure push notifications.
178181See
src/config.rs +4
@@ -558,6 +558,7 @@ impl SortOverrides {
558558pub struct TunableValues {
559559 pub log_level: Level,
560560 pub message_shortcode_display: bool,
561 pub normal_after_send: bool,
561562 pub reaction_display: bool,
562563 pub reaction_shortcode_display: bool,
563564 pub read_receipt_send: bool,
@@ -584,6 +585,7 @@ pub struct TunableValues {
584585pub struct Tunables {
585586 pub log_level: Option<LogLevel>,
586587 pub message_shortcode_display: Option<bool>,
588 pub normal_after_send: Option<bool>,
587589 pub reaction_display: Option<bool>,
588590 pub reaction_shortcode_display: Option<bool>,
589591 pub read_receipt_send: Option<bool>,
@@ -614,6 +616,7 @@ impl Tunables {
614616 message_shortcode_display: self
615617 .message_shortcode_display
616618 .or(other.message_shortcode_display),
619 normal_after_send: self.normal_after_send.or(other.normal_after_send),
617620 reaction_display: self.reaction_display.or(other.reaction_display),
618621 reaction_shortcode_display: self
619622 .reaction_shortcode_display
@@ -645,6 +648,7 @@ impl Tunables {
645648 TunableValues {
646649 log_level: self.log_level.map(Level::from).unwrap_or(Level::INFO),
647650 message_shortcode_display: self.message_shortcode_display.unwrap_or(false),
651 normal_after_send: self.normal_after_send.unwrap_or(false),
648652 reaction_display: self.reaction_display.unwrap_or(true),
649653 reaction_shortcode_display: self.reaction_shortcode_display.unwrap_or(false),
650654 read_receipt_send: self.read_receipt_send.unwrap_or(true),
src/main.rs +3
@@ -596,6 +596,9 @@ impl Application {
596596 None
597597 },
598598 IambAction::Send(act) => {
599 if store.application.settings.tunables.normal_after_send {
600 self.bindings.reset_mode();
601 }
599602 self.screen.current_window_mut()?.send_command(act, ctx, store).await?
600603 },
601604
src/tests.rs +1
@@ -171,6 +171,7 @@ pub fn mock_tunables() -> TunableValues {
171171 default_room: None,
172172 log_level: Level::INFO,
173173 message_shortcode_display: false,
174 normal_after_send: true,
174175 reaction_display: true,
175176 reaction_shortcode_display: false,
176177 read_receipt_send: true,