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

Input buffer has issues with <c-a>, <c-e>, and <BS> #2

Closed
meijieru opened this issue Dec 5, 2021 · 9 comments
Closed

Input buffer has issues with <c-a>, <c-e>, and <BS> #2

meijieru opened this issue Dec 5, 2021 · 9 comments

Comments

@meijieru
Copy link

meijieru commented Dec 5, 2021

The original input method seems compatible with the cmap.
It would be helpful to have them here.

@stevearc
Copy link
Owner

stevearc commented Dec 6, 2021

It is possible to copy over the cmaps to the input modal, but it feels a little weird to me. The original input method uses cmap because it's happening in the command line. This window isn't the command line, it's just serving a purpose that was previously only done through the command line. I just added a specific filetype for the buffer (DressingInput) that will make it easy to add custom mappings. Will that work for you or do you really want all your cmaps available in the modal?

@meijieru
Copy link
Author

meijieru commented Dec 6, 2021

It may help.
Currently, I use tpope/vim-rsi so it would be better to enable them in simple way.
Maybe some presets could be provided?

@stevearc
Copy link
Owner

stevearc commented Dec 6, 2021

It looks like all of those cnoremaps have corresponding inoremaps. Is that not working? If your imaps aren't showing up in the modal that would certainly be a bug

@meijieru
Copy link
Author

meijieru commented Dec 6, 2021

At least the following doesn't work

  • <c-a>: it always inserts to the first character. For example, having text "abc", press <c-a>, insert "xyz", it would be "zyxabc"
  • <c-e> does nothing.

@stevearc
Copy link
Owner

stevearc commented Dec 6, 2021

Okay, I'll test out that plugin and see if I can figure out what's going on

@stevearc
Copy link
Owner

stevearc commented Dec 6, 2021

Turns out this is a bug in Neovim. There are several issues currently affecting the prompt buffer, the <c-a> causing text to be reversed is one, <c-a> breaking <c-e> is another (it works until you <c-a>), and there's a whole host of other problems. Fortunately there is a PR up that fixes everything (I built locally and verified). Unfortunately that means that the prompt buffer is going to be super hosed until the next neovim release, which might be a while.

I'm going to take a crack at re-implementing the input modal without using the prompt buffer. I think that's going to be the only way to avoid these issues for now.

@stevearc stevearc changed the title Consistency with cmap Input buffer has issues with <c-a>, <c-e>, and <BS> Dec 6, 2021
@stevearc
Copy link
Owner

Alright, I have switched the default implementation of input to not use the prompt buffer. It will also look a little different because the "prompt" text will appear in the window border rather than at the beginning of the buffer. Other than that, the functionality should be the same. For anyone else reading this, you can go back to the prompt buffer implementation by setting prompt_buffer = true in the settings.

Let me know if this fixes things for you

@meijieru
Copy link
Author

It works for me. Thx!

@frangio
Copy link

frangio commented May 30, 2024

For anyone reading this now, prompt_buffer is no longer a setting (f487c89).

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

3 participants