Comments (2)
It's not identical. My thinking is that you would call it with something like vim.fn.getpos("'>")
and vim.fn.getpos("'>")
as the visual selection start/end positions to get back most of the coordinates you are currently trying to compute yourself. Probably the majority of buffer_get_selection()
's logic would be replaced by a call to vim.fn.getregionpos()
. But ya, would need to test to make sure it can be used.
from cursorless.
Maybe i misread https://github.com/vim/vim/pull/14617/files#diff-ef8946d89919ad628b9ac65c49d3067e4e017b0980cac70eb25d832a59ef677dR4332 but is it the same?
- getregionpos() takes arguments but buffer_get_selection() does not
getregionpos({pos1}, {pos2} [, {opts}]) *getregionpos()*
Same as |getregion()|, but returns a list of positions
describing the buffer text segments bound by {pos1} and
{pos2}.
The segments are a pair of positions for every line:
[[{pos_start}, {pos_end}], ...]
The position is a |List| with four numbers:
[bufnum, lnum, col, off]
"bufnum" is the buffer number.
"lnum" and "col" are the position in the buffer. The first
column is 1.
The "off" number is zero, unless 'virtualedit' is used. Then
it is the offset in screen columns from the start of the
character. E.g., a position within a <Tab> or after the last
character.
Can also be used as a |method|: >
getpos('.')->getregionpos(getpos("'a"))
<
from cursorless.
Related Issues (20)
- neovim: `"take token"` only selects from current position until the end of the token in normal terminal
- neovim: support clicking targets HOT 3
- neovim: test that neovim's config loads properly
- Switch from `CURSORLESS_TEST` to `CURSORLESS_MODE` environment variable HOT 2
- Add ability to repeat last cursorless command
- keyboard: Add ability to make range past output of modifier
- keyboard: Undo stack for keyboard target
- keyboard: support ordinal modifiers
- keyboard: Switch default maps for surrounding pairs to the delimiters themselves
- keyboard: By default, move selection when user sets keyboard target
- keyboard: Have keyboard target follow selection if it moves
- keyboard: Add support for "rewrap"
- keyboard: Support targeting modes for targeting selection
- Change default nested modifier for tail to stop at "inside"
- parsed actions: Better error message on failed parse
- parsed actions: Handle destination placeholders
- parsed actions: Fill out rest of grammar
- keyboard: Support parsed actions
- neovim: The show logs task can currently fail when it shouldn't
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 cursorless.