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

Alt-Enter doesn't work for commands with placeholders and hotkeys #28

Open
barsv opened this issue Aug 29, 2022 · 0 comments
Open

Alt-Enter doesn't work for commands with placeholders and hotkeys #28

barsv opened this issue Aug 29, 2022 · 0 comments

Comments

@barsv
Copy link

barsv commented Aug 29, 2022

Hi,

I noticed a couple of issues with Alt+Enter.

If I press Alt+Enter for the built-in 'find-and-replace' command :s/{P}/{P}/g then I get:

E5108: Error executing lua ...src/cheatsheet.nvim/lua/cheatsheet/telescope/actions.lua:27: Vim(substitute):E486: Pattern not found: {P}
stack traceback:
        [C]: in function 'nvim_command'
        ...src/cheatsheet.nvim/lua/cheatsheet/telescope/actions.lua:27: in function 'select_current_item'
        ...src/cheatsheet.nvim/lua/cheatsheet/telescope/actions.lua:63: in function 'action'
        ...r1/src/cheatsheet.nvim/lua/cheatsheet/telescope/init.lua:94: in function 'key_func'
        ...e/nvim/plugged/telescope.nvim/lua/telescope/mappings.lua:338: in function 'execute_keymap'
        [string ":lua"]:1: in main chunk
Press ENTER or type command to continue

If I press Alt+Enter for hotkeys like gg to go to the first line then it just doesn't work. I'm not sure if it's a bug or a missing feature.

I looked into the code in actions.lua and I don't get the idea behind it. To me it just looks wrong.

The code is introduced in commit 9716f9a. It's related to issue #11 and PR #12

I fixed the problems and I can create a PR.

The only remaining problem for me is that if I press Enter for a cheat in Telescope then the cheat doesn't get printed at the bottom of the screen. I suspect that it's a regression from telescope. Maybe I will try to look into it later and I will create a separate issue then.

Best regards,
Stan

barsv added a commit to barsv/cheatsheet.nvim that referenced this issue Aug 29, 2022
Fixes Alt+Enter for hotkeys and commands with placeholders.
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