Commit 1045a318c2

1045a318c2a211871af5c6f9a56c40c5a007d06a

parent: 83b503e4a9

Unregistered key

vaw <git@nlih.de> · 2026-08-16 06:45 UTC
committer: <noreply@github.com>

Open `:members` in the same window by default (#458)

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

Layout: unified · split

config.example.toml +1
@@ -10,6 +10,7 @@ default_room = "#iamb-users:0x.badd.cafe"
1010default_split = "vertical"
1111external_edit_file_suffix = ".md"
1212log_level = "warn"
13members_split = "vertical"
1314message_shortcode_display = false
1415open_command = ["my-open", "--file"]
1516reaction_display = true
docs/iamb.5 +9
@@ -205,6 +205,15 @@ for more details.
205205.It Sy message_shortcode_display
206206Defines whether or not Emoji characters in messages should be replaced by their
207207respective shortcodes.
208.It Sy members_split
209When set, this forces the
210.Sy :members
211command to open in a new window split instead of in the same window.
212Possible values are
213.Dq Sy vertical
214or
215.Dq Sy horizontal ,
216to control what kind of split is done.
208217.It Sy message_user_color
209218Defines whether or not the message body is colored like the username.
210219.It Sy normal_after_send
src/config.rs +17 −1
@@ -22,7 +22,10 @@ use ratatui_image::picker::ProtocolType;
2222use serde::{Deserialize, Deserializer, Serialize, de::Error as SerdeError, de::Visitor};
2323use url::Url;
2424
25use modalkit::{env::vim::VimMode, key::TerminalKey, keybindings::InputKey};
25use modalkit::env::vim::VimMode;
26use modalkit::key::TerminalKey;
27use modalkit::keybindings::InputKey;
28use modalkit::prelude::Axis;
2629
2730use super::base::{
2831 IambError,
@@ -463,6 +466,15 @@ pub enum SplitDirection {
463466 Vertical,
464467}
465468
469impl 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
466478#[derive(Clone, Copy, Debug, Eq, PartialEq)]
467479pub struct NotifyVia {
468480 /// Deliver notifications via terminal bell.
@@ -818,6 +830,7 @@ pub struct TunableValues {
818830 pub user_gutter_width: usize,
819831 pub external_edit_file_suffix: String,
820832 pub tabstop: usize,
833 pub members_split: Option<SplitDirection>,
821834 pub default_split: SplitDirection,
822835 pub ssl_verify: bool,
823836}
@@ -865,6 +878,7 @@ pub struct Tunables {
865878 pub user_gutter_width: Option<usize>,
866879 pub external_edit_file_suffix: Option<String>,
867880 pub tabstop: Option<usize>,
881 pub members_split: Option<SplitDirection>,
868882 pub default_split: Option<SplitDirection>,
869883 pub ssl_verify: Option<bool>,
870884}
@@ -911,6 +925,7 @@ impl Tunables {
911925 .external_edit_file_suffix
912926 .or(other.external_edit_file_suffix),
913927 tabstop: self.tabstop.or(other.tabstop),
928 members_split: self.members_split.or(other.members_split),
914929 default_split: self.default_split.or(other.default_split),
915930 ssl_verify: self.ssl_verify.or(other.ssl_verify),
916931 }
@@ -949,6 +964,7 @@ impl Tunables {
949964 .external_edit_file_suffix
950965 .unwrap_or_else(|| ".md".to_string()),
951966 tabstop: self.tabstop.unwrap_or(4),
967 members_split: self.members_split,
952968 default_split: self.default_split.unwrap_or_default(),
953969 ssl_verify: self.ssl_verify.unwrap_or(true),
954970 }
src/tests.rs +1
@@ -204,6 +204,7 @@ pub fn mock_tunables() -> TunableValues {
204204 image_preview: None,
205205 user_gutter_width: 30,
206206 tabstop: 4,
207 members_split: Default::default(),
207208 default_split: Default::default(),
208209 ssl_verify: true,
209210 }
src/windows/room/mod.rs +8 −5
@@ -200,11 +200,14 @@ pub async fn room_command(
200200 Ok(vec![])
201201 },
202202 RoomAction::Members(mut cmd) => {
203 let width = Count::Exact(30);
204 let act = cmd
205 .default_axis(Axis::Vertical)
206 .default_relation(MoveDir1D::Next)
207 .window(OpenTarget::Application(IambId::MemberList(id.to_owned())), width.into());
203 let id = IambId::MemberList(id.to_owned());
204 let target = OpenTarget::Application(id);
205 let cmd = cmd.default_relation(MoveDir1D::Next);
206
207 let act = match store.application.settings.tunables.members_split {
208 Some(dir) => cmd.default_axis(dir.to_axis()).window(target, None),
209 None => cmd.switch(target),
210 };
208211
209212 Ok(vec![(act, cmd.context.clone())])
210213 },