Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keybindings not working after switching state in text regions with 'local-map property #1784

Open
blahgeek opened this issue Apr 22, 2023 · 0 comments

Comments

@blahgeek
Copy link

Issue type

  • Bug report

Environment

Emacs version: GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.17.8) of 2023-04-13
Operating System: archlinux
Evil version: Tested with both 1.15.0 and evil-git-c61bc34
Evil installation type: Tested with MELPA and manual
Graphical/Terminal: X11
Tested in a make emacs session (see CONTRIBUTING.md): No

Reproduction steps

  1. Start with the following minimal init.el:
(require 'evil)
(evil-mode 1)

(defvar-keymap my-mode-map)

(define-derived-mode my-mode fundamental-mode "My Mode"
  "Major mode for editing my files."
  (goto-char (point-max))
  (insert (propertize "some text with local map\n" 'local-map (make-sparse-keymap)))
  (insert "Hello world!\n")
  )

(evil-define-key 'normal my-mode-map
  (kbd "C-c C-c") (lambda () (interactive) (message "C-c C-c pressed")))
  1. Switch to *scratch* buffer, run M-x my-mode
  2. Move cursor to the middle of "some text with local map", press i to enter insert mode, then press <ESC> to leave insert mode
  3. Move cursor to anywhere, press C-c C-c

Expected behavior

Prints "C-c C-c pressed"

Actual behavior

"C-c C-c is undefined"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant