noib3/nvim-oxi

nvim_oxi::api::types::Mode doesn't allow for Remap ("m") mode

turboladen opened this issue · 2 comments

I think I remember running into a similar question when working on turboladen/overkill_nvim and stopped working on it (because this project emerged!)... I see that nvim_oxi::api::types::Mode doesn't have a variant that maps to "m", which I'm wanting to pass to feedkeys() (playing around with InsertCharPre autocompletion). Is it possible I'm looking at the wrong type?

If I have some time, I'd be up for making a PR for this, but I'm not sure if it'd make sense to include Remap/"m" with the existing Mode enum; it looks like feedkeys() modes are slightly different from regular ol' vim modes. I could see an argument for including Remap in the Mode enum; I could see an argument for a separate feedkeys-specific enum; and I could maybe even see a case for adding a Other(String) variant that let users cover cases that the API missed (for whatever reason--maybe even to allow for accommodating future nvim changes?) (this last case is probably kinda weak compared to the other two options, IMO, but still). What are your thoughts about where this should live?

My understanding is that feedkeys()'s modes don't have much to do with vim modes, apart from sharing some character flags. Is that correct? If so, I think creating a separate enum would make the most sense.

feedkeys()'s modes don't have much to do with vim modes, apart from sharing some character flags. Is that correct?

That's my understanding too. I have a fork with a new enum that I'm testing now. If it seems good, I'll put up a PR.