zed-industries/zed · error

Invalid argument: {}

Error message

Invalid argument: {}

What it means

Vim's ex-command error helper `err` reports an invalid or malformed argument for a command (e.g. :split/:delete-marks with a bad target). This is a user-input validation error surfaced through the command bar, not an internal failure.

Source

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

            let project_path = ProjectPath {
                worktree_id: worktree.read(cx).id(),
                path: path.into_arc(),
            };

            let direction = if action.vertical {
                SplitDirection::vertical(cx)
            } else {
                SplitDirection::horizontal(cx)
            };

            workspace
                .split_path_preview(project_path, false, Some(direction), window, cx)
                .detach_and_log_err(cx);
        })
    });

    Vim::action(editor, cx, |vim, action: &DeleteMarks, window, cx| {
        fn err(s: String, window: &mut Window, cx: &mut Context<Editor>) {
            let _ = window.prompt(
                gpui::PromptLevel::Critical,
                &format!("Invalid argument: {}", s),
                None,
                &["Cancel"],
                cx,
            );
        }
        vim.update_editor(cx, |vim, editor, cx| match action {
            DeleteMarks::Marks(s) => {
                if s.starts_with('-') || s.ends_with('-') || s.contains(['\'', '`']) {
                    err(s.clone(), window, cx);
                    return;
                }

                let to_delete = if s.len() < 3 {
                    Some(s.clone())
                } else {

View on GitHub (pinned to f4178619ac)

Solutions

  1. Check the ex-command argument syntax (e.g. valid mark names or file paths)
  2. Quote or escape special characters in the argument
  3. See the error text for which command argument was rejected
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/vim/src/command.rs:576 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/ddf8fd35dc6c77e2. Report an issue: GitHub.