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"
10default_split = "vertical" 10default_split = "vertical"
11external_edit_file_suffix = ".md" 11external_edit_file_suffix = ".md"
12log_level = "warn" 12log_level = "warn"
13members_split = "vertical"
13message_shortcode_display = false 14message_shortcode_display = false
14open_command = ["my-open", "--file"] 15open_command = ["my-open", "--file"]
15reaction_display = true 16reaction_display = true
docs/iamb.5 +9
@@ -205,6 +205,15 @@ for more details.
205.It Sy message_shortcode_display 205.It Sy message_shortcode_display
206Defines whether or not Emoji characters in messages should be replaced by their 206Defines whether or not Emoji characters in messages should be replaced by their
207respective shortcodes. 207respective 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.
208.It Sy message_user_color 217.It Sy message_user_color
209Defines whether or not the message body is colored like the username. 218Defines whether or not the message body is colored like the username.
210.It Sy normal_after_send 219.It Sy normal_after_send
src/config.rs +17 −1
@@ -22,7 +22,10 @@ use ratatui_image::picker::ProtocolType;
22use serde::{Deserialize, Deserializer, Serialize, de::Error as SerdeError, de::Visitor}; 22use serde::{Deserialize, Deserializer, Serialize, de::Error as SerdeError, de::Visitor};
23use url::Url; 23use url::Url;
24 24
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;
26 29
27use super::base::{ 30use super::base::{
28 IambError, 31 IambError,
@@ -463,6 +466,15 @@ pub enum SplitDirection {
463 Vertical, 466 Vertical,
464} 467}
465 468
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
466#[derive(Clone, Copy, Debug, Eq, PartialEq)] 478#[derive(Clone, Copy, Debug, Eq, PartialEq)]
467pub struct NotifyVia { 479pub 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 }
src/tests.rs +1
@@ -204,6 +204,7 @@ pub fn mock_tunables() -> TunableValues {
204 image_preview: None, 204 image_preview: None,
205 user_gutter_width: 30, 205 user_gutter_width: 30,
206 tabstop: 4, 206 tabstop: 4,
207 members_split: Default::default(),
207 default_split: Default::default(), 208 default_split: Default::default(),
208 ssl_verify: true, 209 ssl_verify: true,
209 } 210 }
src/windows/room/mod.rs +8 −5
@@ -200,11 +200,14 @@ pub async fn room_command(
200 Ok(vec![]) 200 Ok(vec![])
201 }, 201 },
202 RoomAction::Members(mut cmd) => { 202 RoomAction::Members(mut cmd) => {
203 let width = Count::Exact(30); 203 let id = IambId::MemberList(id.to_owned());
204 let act = cmd 204 let target = OpenTarget::Application(id);
205 .default_axis(Axis::Vertical) 205 let cmd = cmd.default_relation(MoveDir1D::Next);
206 .default_relation(MoveDir1D::Next) 206
207 .window(OpenTarget::Application(IambId::MemberList(id.to_owned())), width.into()); 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 };
208 211
209 Ok(vec![(act, cmd.context.clone())]) 212 Ok(vec![(act, cmd.context.clone())])
210 }, 213 },