{"record":{"id":"d579980be091048d","repo":"helix-editor/helix","slug":"gutter-type-can-only-be-diagnostics-spacer","errorCode":null,"errorMessage":"Gutter type can only be `diagnostics`, `spacer`, `line-numbers` or `diff`.","messagePattern":"Gutter type can only be `diagnostics`, `spacer`, `line-numbers` or `diff`\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"helix-view/src/editor.rs","lineNumber":924,"sourceCode":"    /// Show one blank space\n    Spacer,\n    /// Highlight local changes\n    Diff,\n    /// Indicator for when code actions are available\n    CodeActionHint,\n}\n\nimpl std::str::FromStr for GutterType {\n    type Err = anyhow::Error;\n\n    fn from_str(s: &str) -> Result<Self, Self::Err> {\n        match s.to_lowercase().as_str() {\n            \"diagnostics\" => Ok(Self::Diagnostics),\n            \"spacer\" => Ok(Self::Spacer),\n            \"line-numbers\" => Ok(Self::LineNumbers),\n            \"diff\" => Ok(Self::Diff),\n            \"code-action-hint\" => Ok(Self::CodeActionHint),\n            _ => anyhow::bail!(\n                \"Gutter type can only be `diagnostics`, `spacer`, `line-numbers` or `diff`.\"\n            ),\n        }\n    }\n}\n\n#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]\n#[serde(default)]\npub struct WhitespaceConfig {\n    pub render: WhitespaceRender,\n    pub characters: WhitespaceCharacters,\n}\n\nimpl Default for WhitespaceConfig {\n    fn default() -> Self {\n        Self {\n            render: WhitespaceRender::Basic(WhitespaceRenderValue::None),\n            characters: WhitespaceCharacters::default(),","sourceCodeStart":906,"sourceCodeEnd":942,"githubUrl":"https://github.com/helix-editor/helix/blob/079a789e8cb08ead67f19e1971a1b7438b37354b/helix-view/src/editor.rs#L906-L942","documentation":"GutterType is the enum for entries in Helix's gutter config list; FromStr accepts \"diagnostics\", \"spacer\", \"line-numbers\", \"diff\", and \"code-action-hint\". Anything else fails when config.toml's gutter array is parsed. Note the error message is stale: it omits \"code-action-hint\" even though that string parses successfully, so the message undersells the valid set.","triggerScenarios":"Putting an unrecognized string in config.toml's gutter = [...] array, e.g. \"git\", \"blame\", \"spaces\", or a typo like \"linenumbers\".","commonSituations":"Users guess gutter names based on other editors' features (git gutter, indent guides) that are not gutter types in this version; copying configs from newer/older Helix versions where the accepted set differs; trusting the error message and not realizing code-action-hint exists.","solutions":["Use only the five accepted values: \"diagnostics\", \"spacer\", \"line-numbers\", \"diff\", \"code-action-hint\".","Remember the error text is outdated — code-action-hint is valid despite not being listed in the message.","Run :config-reload after fixing and check :log-open to confirm the gutter array parses."],"exampleFix":"# before (config.toml)\n gutter = [\"line-numbers\", \"git\"] # error\n\n# after\n gutter = [\"line-numbers\", \"diff\", \"diagnostics\"]","handlingStrategy":"validation","validationCode":"const GUTTERS: &[&str] = &[\"diagnostics\", \"spacer\", \"line-numbers\", \"diff\", \"code-action-hint\"];\n\nfor g in &config.gutter {\n    if !GUTTERS.contains(&g.as_str()) {\n        return Err(anyhow!(\"invalid gutter '{g}'; valid: {GUTTERS:?}\"));\n    }\n}","typeGuard":"fn parse_gutter(s: &str) -> Option<GutterType> {\n    match s.to_lowercase().as_str() {\n        \"diagnostics\" => Some(GutterType::Diagnostics),\n        \"spacer\" => Some(GutterType::Spacer),\n        \"line-numbers\" => Some(GutterType::LineNumbers),\n        \"diff\" => Some(GutterType::Diff),\n        \"code-action-hint\" => Some(GutterType::CodeActionHint),\n        _ => None,\n    }\n}","tryCatchPattern":"let gutters: Vec<GutterType> = config.gutter.iter()\n    .map(|g| g.parse::<GutterType>().map_err(|e| anyhow!(\"config gutter '{g}': {e}\")))\n    .collect::<Result<_>>()?;","preventionTips":["Mirror the accepted set (including code-action-hint) in any validation UI — the built-in message is stale.","Fail config loading with the exact invalid entry and the valid list.","Watch changelogs when gutter types are added or removed between versions."],"tags":["config","gutter","helix","rust"],"backgroundTag":null,"analyzedSha":"079a789e8cb08ead67f19e1971a1b7438b37354b","analyzedAt":"2026-08-16T09:09:59.668Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}