Comments (9)
This shouldn't be too hard to implement, I'm gonna give a shot after #34 is merged. Thanks for reporting.
from pynvim.
Ping. It will be great to have it implemented.
from pynvim.
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):
from pynvim.
It now gives error AttributeError("'NoneType' object has no attribute 'start'",)
from pynvim.
Now that I read python-vim
documentation more carefully, I saw that this will requires changes on both nvim and the python client. The problem is that the python/pyfile commands can receive ranges but it's not currently being passed to the python provider. Would you mind opening an issue on nvim repository?
from pynvim.
I opened a new issue at the main repo.
from pynvim.
@bjin thanks, I tagged the issue as entry-level. If no one does this until the of next week I will do it myself.
from pynvim.
@bjin If you update Neovim/python-client to the latest versions this issue should be fixed
from pynvim.
Yes, I can verify that it works. Thanks. Closing
from pynvim.
Related Issues (20)
- Can't install pynvim with pipx HOT 1
- `num_to_str` boolean check makes `Ultisnips` snippet engine laggy HOT 5
- pin install pynvim fails to build greenlet on windows HOT 1
- Test failures: "Event loop is closed" with Python 3.12, Fedora Linux HOT 6
- test_vim.py fails with Python 3.12 HOT 1
- Controlling neovim from jupyter notebook: "another loop is running" HOT 4
- Get error "no module named imp" with Python 3.12 HOT 8
- No longer works in Python 3.12 HOT 4
- `<abuf>` is wrong for `BufUnload` with hidden buffer HOT 2
- luaeval behavior: functions are silently returning `None` HOT 3
- docs (readthedocs) CI is failing HOT 4
- Output flooded with EventLoop related messages HOT 5
- checkhealth WARNING: Could not contact PyPI to get latest version HOT 8
- Python 3.8: TypeError: 'type' object is not subscriptable HOT 11
- Access output of lua commands HOT 3
- UpdateRemotePlugins not finding any specs HOT 1
- Synchronous call initiated through a response of an async call drops the results of the sync call. HOT 4
- simplify remote plugins
- How do you access the treesitter API via pynvim? HOT 1
- test_vim: Failure with Python 3.13 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pynvim.