Skip to content

Commit ce7db35

Browse files
committed
fix: zjframes only working on first tab
fixes #109
1 parent 6eb5fb0 commit ce7db35

File tree

5 files changed

+24
-6
lines changed

5 files changed

+24
-6
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/target
22
.direnv/
33
.zjstatus.log
4+
.zjframes.log

src/bin/zjframes.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fn init_tracing() {
3232
use std::fs::File;
3333
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
3434

35-
let file = File::create("/host/.zjstatus.log");
35+
let file = File::create("/host/.zjframes.log");
3636
let file = match file {
3737
Ok(file) => file,
3838
Err(error) => panic!("Error: {:?}", error),
@@ -143,6 +143,7 @@ impl State {
143143
&self.state.panes,
144144
&self.state.mode,
145145
get_plugin_ids(),
146+
true,
146147
);
147148
}
148149
Event::PaneUpdate(pane_info) => {
@@ -159,6 +160,7 @@ impl State {
159160
&self.state.panes,
160161
&self.state.mode,
161162
get_plugin_ids(),
163+
true,
162164
);
163165
}
164166
Event::PermissionRequestResult(result) => {
@@ -181,6 +183,7 @@ impl State {
181183
&current_session.panes,
182184
&self.state.mode,
183185
get_plugin_ids(),
186+
true,
184187
);
185188
}
186189
}

src/bin/zjstatus.rs

+2
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ impl State {
208208
&pane_info,
209209
&self.state.mode,
210210
get_plugin_ids(),
211+
false,
211212
);
212213

213214
self.state.panes = pane_info;
@@ -267,6 +268,7 @@ impl State {
267268
&current_session.panes,
268269
&self.state.mode,
269270
get_plugin_ids(),
271+
false,
270272
);
271273
}
272274

src/frames.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub fn hide_frames_conditionally(
99
pane_info: &PaneManifest,
1010
mode_info: &ModeInfo,
1111
plugin_pane_id: PluginIds,
12+
is_zjframes: bool,
1213
) {
1314
if !cfg_hide_frames_for_single_pane
1415
&& !cfg_hide_frames_except_for_search
@@ -24,8 +25,11 @@ pub fn hide_frames_conditionally(
2425

2526
// check if we are running for the current tab since one plugin will run for
2627
// each tab. If we do not prevent execution, the screen will start to flicker
27-
// 'cause every plugin will try to toggle the frames
28-
if !is_plugin_for_current_tab(&panes, plugin_pane_id) {
28+
// 'cause every plugin will try to toggle the frames.
29+
//
30+
// This is only relevant for zjstatus, not zjframes; as zjframes only
31+
// runs once per session.
32+
if !is_plugin_for_current_tab(&panes, plugin_pane_id) && !is_zjframes {
2933
return;
3034
}
3135

tests/zjframes/config.kdl

+11-3
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ plugins {
221221
// Plugins to load in the background when a new session starts
222222
load_plugins {
223223
"file:./target/wasm32-wasip1/debug/zjframes.wasm" {
224-
hide_frame_for_single_pane "false"
224+
hide_frame_for_single_pane "true"
225225
hide_frame_except_for_search "true"
226226
hide_frame_except_for_fullscreen "true"
227227
}
@@ -259,7 +259,15 @@ load_plugins {
259259
// - true (default)
260260
// - false
261261
//
262-
// pane_frames true
262+
pane_frames true
263+
264+
265+
ui {
266+
pane_frames {
267+
hide_session_name true
268+
rounded_corners true
269+
}
270+
}
263271

264272
// Toggle between having Zellij lay out panes according to a predefined set of layouts whenever possible
265273
// Options:
@@ -274,7 +282,7 @@ load_plugins {
274282
// - true (default)
275283
// - false
276284
//
277-
// session_serialization false
285+
session_serialization false
278286

279287
// Whether pane viewports are serialized along with the session, default is false
280288
// (Requires restart)

0 commit comments

Comments
 (0)