aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-tile
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2025-06-10 17:23:46 +0200
committerGitHub <noreply@github.com>2025-06-10 17:23:46 +0200
commit7ef7cd5ecd13974b0f51eec87df164249c294a4c (patch)
tree234b3fdc1ad652a45c8aec3c8e957f4b1452f3e6 /zellij-tile
parentfeat(ux): improve multiple select (#4221) (diff)
downloadsl0ppij-7ef7cd5ecd13974b0f51eec87df164249c294a4c.tar.gz
sl0ppij-7ef7cd5ecd13974b0f51eec87df164249c294a4c.tar.xz
sl0ppij-7ef7cd5ecd13974b0f51eec87df164249c294a4c.zip
feat(ui): add optional tooltip with key hints to the compact bar (#4225)
* initial implementation * some refactoring * refactor: separate some concerns and tidy up * fix: move tooltip to focused tab as needed * some ux adjustments * some refactoring * only show tooltip if we have configured a shortcut key * add plugin artifacts * fix tests * truncate tooltip if it exceeds width * change config name * remove comment * docs(changelog): add PR
Diffstat (limited to 'zellij-tile')
-rw-r--r--zellij-tile/src/shim.rs2
-rw-r--r--zellij-tile/src/ui_components/text.rs5
2 files changed, 5 insertions, 2 deletions
diff --git a/zellij-tile/src/shim.rs b/zellij-tile/src/shim.rs
index d67768f1..3dda6d1f 100644
--- a/zellij-tile/src/shim.rs
+++ b/zellij-tile/src/shim.rs
@@ -1183,7 +1183,7 @@ pub fn break_panes_to_new_tab(
unsafe { host_run_plugin_command() };
}
-/// Create a new tab that includes the specified pane ids
+/// Move the pane ids to the tab with the specified index
pub fn break_panes_to_tab_with_index(
pane_ids: &[PaneId],
tab_index: usize,
diff --git a/zellij-tile/src/ui_components/text.rs b/zellij-tile/src/ui_components/text.rs
index 787125b5..68e8c0a1 100644
--- a/zellij-tile/src/ui_components/text.rs
+++ b/zellij-tile/src/ui_components/text.rs
@@ -60,7 +60,7 @@ impl Text {
while let Some(pos) = self.text[start..].find(substr) {
let abs_pos = start + pos;
- self = self.color_range(index_level, abs_pos..abs_pos + substr.len());
+ self = self.color_range(index_level, abs_pos..abs_pos + substr.chars().count());
start = abs_pos + substr.len();
}
@@ -92,6 +92,9 @@ impl Text {
self
}
+ pub fn content(&self) -> &str {
+ &self.text
+ }
fn pad_indices(&mut self, index_level: usize) {
if self.indices.get(index_level).is_none() {
for _ in self.indices.len()..=index_level {