zed-industries/zed · error

mark {name} not set

Error message

mark {name} not set

What it means

Raised while resolving a vim Position::Mark when the requested mark name has no local anchor set in the current editor. The mark (e.g. 'a) was never placed, so its row cannot be resolved for the range or offset computation.

Source

Thrown at crates/vim/src/command.rs:1360

                    editor.buffer().read(cx).buffer_point_to_anchor(
                        &buffer,
                        Point::new(row.saturating_sub(1), 0),
                        cx,
                    )
                }) {
                    anchor
                        .to_point(&snapshot.buffer_snapshot())
                        .row
                        .saturating_add_signed(*offset)
                } else {
                    row.saturating_add_signed(offset.saturating_sub(1))
                }
            }
            Position::Mark { name, offset } => {
                let Some(Mark::Local(anchors)) =
                    vim.get_mark(&name.to_string(), editor, window, cx)
                else {
                    anyhow::bail!("mark {name} not set");
                };
                let Some(mark) = anchors.last() else {
                    anyhow::bail!("mark {name} contains empty anchors");
                };
                mark.to_point(&snapshot.buffer_snapshot())
                    .row
                    .saturating_add_signed(*offset)
            }
            Position::LastLine { offset } => snapshot
                .buffer_snapshot()
                .max_row()
                .0
                .saturating_add_signed(*offset),
            Position::CurrentLine { offset } => editor
                .selections
                .newest_anchor()
                .head()
                .to_point(&snapshot.buffer_snapshot())

View on GitHub (pinned to f4178619ac)

Solutions

  1. Set the mark first (e.g. `m{name}` in normal mode) before using it in a range/command
  2. Check for a typo in the mark name
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/vim/src/command.rs:1360 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/43139ba5f77ca670. Report an issue: GitHub.