{"record":{"id":"e8238dfd26c0b1a0","repo":"zed-industries/zed","slug":"operator-popped-when-no-operator-was-on-the-stack","errorCode":null,"errorMessage":"Operator popped when no operator was on the stack. This likely means there is an invalid keymap config","messagePattern":"Operator popped when no operator was on the stack\\. This likely means there is an invalid keymap config","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/vim/src/vim.rs","lineNumber":1792,"sourceCode":"        self.sync_vim_settings(window, cx)\n    }\n\n    fn select_register(&mut self, register: Arc<str>, window: &mut Window, cx: &mut Context<Self>) {\n        if register.chars().count() == 1 {\n            self.selected_register\n                .replace(register.chars().next().unwrap());\n        }\n        self.operator_stack.clear();\n        self.sync_vim_settings(window, cx);\n    }\n\n    fn maybe_pop_operator(&mut self) -> Option<Operator> {\n        self.operator_stack.pop()\n    }\n\n    fn pop_operator(&mut self, window: &mut Window, cx: &mut Context<Self>) -> Operator {\n        let popped_operator = self.operator_stack.pop()\n            .expect(\"Operator popped when no operator was on the stack. This likely means there is an invalid keymap config\");\n        self.sync_vim_settings(window, cx);\n        popped_operator\n    }\n\n    fn clear_operator(&mut self, window: &mut Window, cx: &mut Context<Self>) {\n        if matches!(self.active_operator(), Some(Operator::HelixJump { .. })) {\n            self.clear_helix_jump_ui(window, cx);\n        }\n        Vim::take_count(cx);\n        Vim::take_forced_motion(cx);\n        self.selected_register.take();\n        self.operator_stack.clear();\n        self.sync_vim_settings(window, cx);\n    }\n\n    fn clear_helix_jump_ui(&mut self, _window: &mut Window, cx: &mut Context<Self>) {\n        self.update_editor(cx, move |_, editor, cx| {\n            editor.clear_navigation_overlays(HELIX_JUMP_OVERLAY_KEY, cx);","sourceCodeStart":1774,"sourceCodeEnd":1810,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/vim/src/vim.rs#L1774-L1810","documentation":"Vim's pop_operator asserts the operator stack is non-empty when popping. An empty stack means keymap bindings dispatched an operator-consuming action without a preceding operator — usually a custom keymap misconfiguration.","triggerScenarios":"Thrown at crates/vim/src/vim.rs:1792 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the custom keymap so operator actions are bound consistently","Guard pop_operator to return a default operator when the stack is empty","Clear or resync operator state on mode changes"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}