Skip to content

Focus highlight doesn't follow FocusNextPane, only FocusPreviousPane #37

Description

@GeneralD

type severity impact reproducibility workaround

Problem

Cycling pane focus in the two directions behaves asymmetrically in the minimap: switching backward (FocusPreviousPane) moves the focus highlight to the newly focused pane as expected, but switching forward (FocusNextPane) leaves the highlight where it was — no pane changes color at all.

Steps to Reproduce

  1. Open a tab with 2+ tiled panes (highlight ring visible on the focused pane).
  2. Trigger FocusNextPane (bound to e.g. + ]) — actual focus moves (cursor lands in the next pane).
  3. Trigger FocusPreviousPane (e.g. + [) for comparison.

Expected Behavior

Both directions move the focus ring/highlight to the newly focused pane.

Actual Behavior

  • FocusPreviousPane: highlight follows the focus. ✅
  • FocusNextPane: focus moves in zellij, but no pane in the minimap changes color. ❌

Relevant Code

  • src/projection.rs:44is_focused is passed straight through from zellij's PaneInfo; the plugin derives the highlight purely from this flag.
  • src/lib.rs:144-147 — every PaneUpdate replaces self.panes and triggers a repaint; there is no plugin-side caching that could pin a stale highlight.

Given that pass-through structure, the prime suspect is the data delivered on PaneUpdate after FocusNextPane (stale or missing is_focused flip), rather than the render path — but that needs to be confirmed with a payload dump.

Diagnostics / Proposed Steps

  1. Log the is_focused flags from each PaneUpdate while cycling both directions to confirm whether zellij delivers the flip for FocusNextPane.
  2. If zellij does deliver it → bug is in tabmap; bisect the projection/render path.
  3. If zellij does not → check zellij 0.44.x for known focus_next_pane event-emission issues; consider deriving the focused pane from a complementary signal (e.g. TabUpdate/ModeUpdate) or reporting upstream.

Environment

  • zellij 0.44.3 (macOS)
  • zellij-tabmap v0.2.x (observed on the current release line)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingrenderingMinimap / color / label rendering

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions