-
Notifications
You must be signed in to change notification settings - Fork 3
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
refactor: merge VimMode into the api abstraction #27
base: main
Are you sure you want to change the base?
Conversation
I still need to look at this, but two questions:
|
This PR is a simple refactor of what there was in talon-vim. The idea is to cleanup the code in order to make it easier to maintain. It should not change its functionality. So testing any command that uses RPC is good indeed.
I am not sure to follow why you want to uninstall pynvim. This PR still uses pynvim. It is just code refactoring to make it easier to maintain from now on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if you add the inheritance and rebase to fix the merge conflicts this is fine. I took it for a spin and it seems to work fine.
I dunno why bought I thought this whole PR was something way more complicated, even after taking a quick glance last time, that was gonna cause a bunch of conflicts with talon-vim but is totally something different.
I'll file an issue, but just something to note is the fact that the class inheritance didn't exist and didn't cause any issues makes me think it's worth doing a big typing pass where everything is strongly typed, and then enforce it with mypy.
except ImportError: | ||
pynvim = None | ||
|
||
import time | ||
|
||
|
||
class VimRPC: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a subclass of VimApiInternal ya?
@@ -11,82 +11,82 @@ | |||
class Actions: | |||
def vim_set_normal(auto: bool = True): | |||
"""set normal mode""" | |||
v = VimMode() | |||
v = VimAPI() | |||
v.set_normal_mode(auto=auto) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably causing a merge conflict as we removed auto=auto iirc
This is an attempt to refactor the code in order to abstract everything into the VimApi abstraction. This PR only deals with VimMode and merge it into VimApi.
Other parts could be merged later, but this is just the starting point if we agree to go this way. I would rather have this merged before going further.