diff options
| author | Aram Drevekenin <aram@poor.dev> | 2025-07-21 09:40:43 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-21 09:40:43 +0200 |
| commit | 7d970c70902581c711fb0b632f6f007936b984e6 (patch) | |
| tree | bbe950c6a0c85e6ff33f094ff24083526fa632c9 /default-plugins/multiple-select | |
| parent | fix(ux): allow pasting and inputing wide-chars in search + tab rename + pane ... (diff) | |
| download | sl0ppij-7d970c70902581c711fb0b632f6f007936b984e6.tar.gz sl0ppij-7d970c70902581c711fb0b632f6f007936b984e6.tar.xz sl0ppij-7d970c70902581c711fb0b632f6f007936b984e6.zip | |
fix: stack ordering command (#4308)
* fix: some issues with stacking panes
* cleanups and formatting
* docs(changelog): add PR
Diffstat (limited to 'default-plugins/multiple-select')
| -rw-r--r-- | default-plugins/multiple-select/src/main.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/default-plugins/multiple-select/src/main.rs b/default-plugins/multiple-select/src/main.rs index 8017bb69..bd6a8a58 100644 --- a/default-plugins/multiple-select/src/main.rs +++ b/default-plugins/multiple-select/src/main.rs @@ -186,20 +186,29 @@ impl App { fn update_grouped_panes(&mut self, pane_manifest: &PaneManifest, own_client_id: ClientId) { self.grouped_panes.clear(); let mut count = 0; + let mut panes_with_index = Vec::new(); for (_tab_index, pane_infos) in &pane_manifest.panes { for pane_info in pane_infos { - if pane_info.index_in_pane_group.get(&own_client_id).is_some() { + if let Some(index_in_pane_group) = pane_info.index_in_pane_group.get(&own_client_id) + { let pane_id = if pane_info.is_plugin { PaneId::Plugin(pane_info.id) } else { PaneId::Terminal(pane_info.id) }; - self.grouped_panes.push(pane_id); + panes_with_index.push((*index_in_pane_group, pane_id)); count += 1; } } } + + panes_with_index.sort_by_key(|(index, _)| *index); + + for (_, pane_id) in panes_with_index { + self.grouped_panes.push(pane_id); + } + if count == 0 { self.close_self(); } |
