-
Notifications
You must be signed in to change notification settings - Fork 118
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
vim.current.range is not supported #35
Comments
This shouldn't be too hard to implement, I'm gonna give a shot after #34 is merged. Thanks for reporting. |
Ping. It will be great to have it implemented. |
Sorry, I had completely forgot about this. I'm a bit out of time lately, could you test if this patch fixes the problem? If it does I will merge to master later today. diff --git a/neovim/api/buffer.py b/neovim/api/buffer.py
index c33c249..e0f7b3b 100644
--- a/neovim/api/buffer.py
+++ b/neovim/api/buffer.py
@@ -115,7 +115,9 @@ class Buffer(Remote):
def range(self, start, end):
"""Return a `Range` object, which represents part of the Buffer."""
- return Range(self, start, end)
+ rv = Range(self, start, end)
+ self._session.current_range = rv
+ return rv
@property
def name(self):
diff --git a/neovim/api/nvim.py b/neovim/api/nvim.py
index cd9eb4c..f55143c 100644
--- a/neovim/api/nvim.py
+++ b/neovim/api/nvim.py
@@ -229,6 +229,10 @@ class Current(object):
def tabpage(self, tabpage):
return self._session.request('vim_set_current_tabpage', tabpage)
+ @property
+ def range(self):
+ return getattr(self._session, 'current_range', None)
+
class ExtHook(SessionHook):
def __init__(self, types): |
It now gives error |
Now that I read |
I opened a new issue at the main repo. |
@bjin thanks, I tagged the issue as entry-level. If no one does this until the of next week I will do it myself. |
@bjin If you update Neovim/python-client to the latest versions this issue should be fixed |
Yes, I can verify that it works. Thanks. Closing |
I tried to run clang-format.py with python client, but noticed that vim.current.range is not supported yet. Is there any plan on supporting it or any other workarounds?
The text was updated successfully, but these errors were encountered: