Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Oni completions are not dot repeatable #2501

Closed
jwmann opened this issue Aug 10, 2018 · 5 comments
Closed

Oni completions are not dot repeatable #2501

jwmann opened this issue Aug 10, 2018 · 5 comments

Comments

@jwmann
Copy link

jwmann commented Aug 10, 2018

Oni Version: 0.3.6
Operating System: MacOS 10.13.6

Issue:
When selecting a completion from the suggestion list, after autocompleting, it can't be dot repeatable

Expected behavior:
Autocomplete a word and dot repeat will insert the whole word again

Actual behavior:
The first word autocomplete and dot repeating will only insert the manually typed in portion of the completion

Steps to reproduce:
const fooBar;

  1. Type foo a suggestion will appear
  2. Press <Enter>, fooBar will be completed.
  3. Press . and only foo will be repeated.
@CrossR
Copy link
Member

CrossR commented Aug 12, 2018

I think this is covered over in #1200, but it is getting more and more on my nerves.

Its possible we just need to look into the nvim API a bit more and see if we can have macros replay msgpack calls, or have nvim core decode the msgpack call and have its contents as part of the macros.

I'll closes this out for now.

@CrossR CrossR closed this as completed Aug 12, 2018
@vlcinsky
Copy link

Would https://github.com/tpope/vim-repeat apply here?

@jwmann
Copy link
Author

jwmann commented Aug 12, 2018

@vlcinsky Maybe? I'm already using it but maybe it needs to be integrated on Oni's side internally

@CrossR
Copy link
Member

CrossR commented Aug 12, 2018

I don't think so @vlcinsky. To my knowledge (mainly from the other ticket, but also from a bit of the code), the issue is more that technically two types of input are happening, which macros, . and whatever else can't deal with.

That is, normal keyboard input, as well as changes to the buffer via the neovim API. I'd assume that vim-repeat also has no knowledge of the neovim API (since its neovim specific) either, which is the main issue.

We'd either need to:

  • Stop using the API for stuff like this, and instead call normal nvim commands to pass over keypresses, which could then be picked up like anything else. Thats not too hard...but also a bit hacky, and feels like it could fall apart with race issues or something.
  • See about neovim-core changes, such that macros, . and more can replay not only neovim events, (keystrokes and such) but also things passed over from the API. As said in the other issue, thats probably a gigantic hassle on the nvim side.
  • Deal with it all in Oni, by having Oni remember the things applied, such that we can overload macros and whatnot, so they'd be aware of the Oni side of things. Thats also a fairly big task.

Not too sure what the easiest fix for all this is to be honest...or how other nvim UIs have dealt with it/if they've encountered it. Its possible we just need to implement some of this sort of logic in the vimscript layer, but we are trying to not have too much of that.

@akinsho
Copy link
Member

akinsho commented Aug 15, 2018

I wonder if potential other solution could be that rather than having oni's autocomplete menu completely sidestep vim's popup we could actually just populate the vim's completion menu with the language server results like nvim-typescript or deoplete do that way all we do is populate a menu and vim is in control of inserting the text.

This could also make way for having vim and oni completion combined (but differentiated), though this sort of a change would definitely need some input from @bryphe as he may not like the idea?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants