stevearc / dressing.nvim

Neovim plugin to improve the default vim.ui interfaces
MIT License
1.73k stars 32 forks source link

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

Closed meijieru closed 2 years ago

meijieru commented 2 years ago

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

stevearc commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

At least the following doesn't work

stevearc commented 2 years ago

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

stevearc commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

It works for me. Thx!

frangio commented 2 months ago

For anyone reading this now, prompt_buffer is no longer a setting (https://github.com/stevearc/dressing.nvim/commit/f487c89b56e5fb4b86d50b5b136402089e0958c7).