{"record":{"id":"8fd359aee753fd77","repo":"micro-editor/micro","slug":"invalid-option","errorCode":null,"errorMessage":"Invalid option","messagePattern":"Invalid option","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/config/settings.go","lineNumber":145,"sourceCode":"\t\"pluginchannels\": []string{\"https://raw.githubusercontent.com/micro-editor/plugin-channel/master/channel.json\"},\n\t\"pluginrepos\":    []string{},\n\t\"savehistory\":    true,\n\t\"scrollbarchar\":  \"|\",\n\t\"sucmd\":          \"sudo\",\n\t\"tabalways\":      false,\n\t\"tabhighlight\":   false,\n\t\"tabreverse\":     true,\n\t\"xterm\":          false,\n}\n\n// a list of settings that should never be globally modified\nvar LocalSettings = []string{\n\t\"filetype\",\n\t\"readonly\",\n}\n\nvar (\n\tErrInvalidOption    = errors.New(\"Invalid option\")\n\tErrInvalidValue     = errors.New(\"Invalid value\")\n\tErrOptNotToggleable = errors.New(\"Option not toggleable\")\n\n\t// The options that the user can set\n\tGlobalSettings map[string]any\n\n\t// This is the raw parsed json\n\tparsedSettings     map[string]any\n\tsettingsParseError bool\n\n\t// ModifiedSettings is a map of settings which should be written to disk\n\t// because they have been modified by the user in this session\n\tModifiedSettings map[string]bool\n\n\t// VolatileSettings is a map of settings which should not be written to disk\n\t// because they have been temporarily set for this session only\n\tVolatileSettings map[string]bool\n)","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/micro-editor/micro/blob/1c8b82b32e408a5faf340039ed92d5266bea3293/internal/config/settings.go#L127-L163","documentation":"Sentinel error config.ErrInvalidOption from config.GetNativeValue when GetGlobalOption(option) returns nil, i.e. the option name is not present in the merged defaults (defaultCommonSettings + DefaultGlobalOnlySettings). It means you asked to set an option micro does not know. The same sentinel is reused by the command layer (`set` in the command bar) and buffer-local settings.","triggerScenarios":"Running `set relativenumbers true` (name doesn't exist; the real option is 'relativenumber'), or programmatically config.GetNativeValue('softtab', '2') — evaluated against the defaults maps in internal/config/settings.go:145/504. Any typo'd or removed option name produces exactly this error.","commonSituations":"Typos at the command bar, options removed/renamed across micro versions (settings.json keys, however, are kept as unknown without this error), and tutorials referencing options that don't exist in the user's micro version.","solutions":["List valid options: type `set ` and use Tab completion in the command bar, or check the options help for your version.","Fix the spelling: common ones are 'relativenumber' (not relativenumbers), 'softtabs' vs 'tabsize' — match the documented name exactly.","If an option vanished after upgrading, check the release notes/changelog for its rename and use the new name.","Programmatic callers: verify with config.GetGlobalOption(name) != nil before setting."],"exampleFix":"; before (command bar):\n> set relativenumbers true   ; error: Invalid option\n\n; after:\n> set relatenumber off -> no; correct name:\n> set relatenumber -> no; use:\n> set relativenumber true","handlingStrategy":"validation","validationCode":"func optionExists(name string) bool {\n    return config.GetGlobalOption(name) != nil // nil means unknown to micro\n}\n\nif optionExists(next) {\n    config.SetGlobalOption(name, value)\n}","typeGuard":"func isKnownOption(name string) bool {\n    _, known := config.DefaultAllSettings()[name]\n    return known\n}","tryCatchPattern":"val, err := config.GetNativeValue(name, strVal)\nif err != nil {\n    if errors.Is(err, config.ErrInvalidOption) {\n        // name is wrong: suggest from config.DefaultAllSettings() keys, abort set\n    }\n}","preventionTips":["Discover options via `set` + Tab completion instead of typing names from memory.","In scripts driving micro, validate names against config.DefaultAllSettings() first.","After a micro upgrade, re-check custom option lists for removed/renamed names."],"tags":["settings","options","command-bar","typo"],"backgroundTag":null,"analyzedSha":"1c8b82b32e408a5faf340039ed92d5266bea3293","analyzedAt":"2026-08-15T20:01:45.134Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}