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

Filter bad register names #1212

Closed
wants to merge 3 commits into from
Closed

Filter bad register names #1212

wants to merge 3 commits into from

Conversation

sanel
Copy link
Contributor

@sanel sanel commented Dec 1, 2019

Some modes, like fzf.el, will put :fzf-windows as register name,
causing Evil :register command to fail. This command, but also Vim,
expects registers to be named with number or character.

This is not much fault of fzf.el mode (or similar modes), because
Emacs keeps both window configuration and marks in a single
"register-alist" and mode developers are free to use whetever name for
restoring window configurations.

This commit fixes it by filtering out all register names not conforming to
proper Vim-like naming schema.

Some modes, like fzf.el, will put :fzf-windows as register name,
causing Evil :register command to fail. This command, but also Vim,
expects registers to be named with number or character.

This is not much fault of fzf.el mode (or similar modes), because
Emacs keeps both window configuration and marks in a single
"register-alist" and mode developers are free to use whetever name for
restoring window configurations.

This commit fixes it by filtering out all register names not conforming to
proper Vim-like naming schema.
evil-common.el Outdated Show resolved Hide resolved
@TheBB
Copy link
Member

TheBB commented Dec 2, 2019

Thanks! Squashed and merged manually.

  • I changed the filtering function, since the list is an alist and you want to filter on the keys, not the cons cells.
  • I also removed the note in the commit message that fzf.el is not at fault. The documentation of register-alist says that they keys must be numbers, so if some package adds non-numbers there then as far as I am concerned it is their problem. However I guess this filtering doesn't hurt.

@TheBB
Copy link
Member

TheBB commented Dec 2, 2019

Reported to fzf at bling/fzf.el#54

@sanel
Copy link
Contributor Author

sanel commented Dec 2, 2019

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants