{"record":{"id":"d948299d6785e967","repo":"ssssssss-team/spider-flow","slug":"inconsistent-bindings-for-name","errorCode":null,"errorMessage":"Inconsistent bindings for \" + name","messagePattern":"Inconsistent bindings for \" \\+ name","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"spider-flow-web/src/main/resources/static/js/codemirror/codemirror.js","lineNumber":6761,"sourceCode":"    var copy = {};\n    for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n      var value = keymap[keyname];\n      if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n      if (value == \"...\") { delete keymap[keyname]; continue }\n\n      var keys = map(keyname.split(\" \"), normalizeKeyName);\n      for (var i = 0; i < keys.length; i++) {\n        var val = (void 0), name = (void 0);\n        if (i == keys.length - 1) {\n          name = keys.join(\" \");\n          val = value;\n        } else {\n          name = keys.slice(0, i + 1).join(\" \");\n          val = \"...\";\n        }\n        var prev = copy[name];\n        if (!prev) { copy[name] = val; }\n        else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n      }\n      delete keymap[keyname];\n    } }\n    for (var prop in copy) { keymap[prop] = copy[prop]; }\n    return keymap\n  }\n\n  function lookupKey(key, map$$1, handle, context) {\n    map$$1 = getKeyMap(map$$1);\n    var found = map$$1.call ? map$$1.call(key, context) : map$$1[key];\n    if (found === false) { return \"nothing\" }\n    if (found === \"...\") { return \"multi\" }\n    if (found != null && handle(found)) { return \"handled\" }\n\n    if (map$$1.fallthrough) {\n      if (Object.prototype.toString.call(map$$1.fallthrough) != \"[object Array]\")\n        { return lookupKey(key, map$$1.fallthrough, handle, context) }\n      for (var i = 0; i < map$$1.fallthrough.length; i++) {","sourceCodeStart":6743,"sourceCodeEnd":6779,"githubUrl":"https://github.com/ssssssss-team/spider-flow/blob/c799cca99c7d064673dc79e6ef06a08bbc0e292d/spider-flow-web/src/main/resources/static/js/codemirror/codemirror.js#L6743-L6779","documentation":"CodeMirror's keymap normalization builds composite bindings like 'Ctrl-X Ctrl-C' and detects when the same prefix name maps to two different values ('...' continuation vs an actual command). Conflicting definitions for the same key sequence throw this error.","triggerScenarios":"Adding two entries to an keyMap whose multi-stroke prefixes collide, e.g. {'Ctrl-X': fn1, 'Ctrl-X Ctrl-C': fn2} — 'Ctrl-X' would need to be both a command and a '...' continuation — or nested keymaps flattened by normalizeKeyMap with inconsistent prefixes.","commonSituations":"Merging several keymap objects (plugin keymaps + user keymaps) where both define overlapping multi-key sequences, or hand-writing normalizeKeyMap input with a prefix that is also a final binding.","solutions":["Remove or rename the conflicting key so a prefix is either a command or a continuation, not both","Namespace one plugin's bindings under a different first key to avoid collisions","Merge keymaps consciously: pick one value for the colliding prefix before normalizing"],"exampleFix":"// before\nvar map = {\"Ctrl-X\": quit, \"Ctrl-X Ctrl-S\": save}; // conflict\n// after\nvar map = {\"Ctrl-Q\": quit, \"Ctrl-X Ctrl-S\": save};","handlingStrategy":"validation","validationCode":"function checkMultiStrokeConflicts(keymap) {\n  var prefixes = {};\n  for (var key in keymap) {\n    var parts = key.split(\" \");\n    for (var i = 1; i < parts.length; i++) {\n      var prefix = parts.slice(0, i).join(\" \");\n      if (keymap[prefix] && keymap[prefix] !== \"...\") return prefix;\n      prefixes[prefix] = true;\n    }\n  }\n  return null;\n}\nvar conflict = checkMultiStrokeConflicts(myKeymap);","typeGuard":null,"tryCatchPattern":"try {\n  var map = CodeMirror.normalizeKeyMap(rawMap);\n} catch (e) {\n  if (/Inconsistent bindings/.test(e.message)) {\n    var map = CodeMirror.normalizeKeyMap(Object.assign({}, rawMap, conflictedPrefixRemoved));\n  } else { throw e; }\n}","preventionTips":["A key used as a multi-stroke prefix (e.g. 'Ctrl-X') must map to '...' or be absent, never to a command","When merging plugin keymaps, detect prefix collisions before combining","Prefer unique first keys per plugin to avoid composite-sequence collisions"],"tags":["codemirror","keybindings","conflict"],"backgroundTag":"invalid-config-value","analyzedSha":"c799cca99c7d064673dc79e6ef06a08bbc0e292d","analyzedAt":"2026-09-08T13:47:08.225Z","contentChangedAt":"2026-09-08T13:47:08.225Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}