Skip to content
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

getregionpos() returns a list of buffer segments for a given range #14609

Closed
justinmk opened this issue Apr 21, 2024 · 0 comments
Closed

getregionpos() returns a list of buffer segments for a given range #14609

justinmk opened this issue Apr 21, 2024 · 0 comments

Comments

@justinmk
Copy link
Contributor

Problem

A buffer region in Vim, is described by four parameters: {pos1}, {pos2}, {regtype}, {inclusive}

Any function that accepts only {pos1}, {pos2} must either be reworked to also accept {regtype}, {inclusive}, or the caller must manually figure out the buffer segments that map to the "region", and feed them into the function.

Feature request

Extracted from discussion in #13998 (comment)

(Main use case here: highlight-on-yank as in https://github.com/machakann/vim-highlightedyank.)

Introduce getregionpos({pos1}, {pos2}, {regtype}, {inclusive}) which returns a list of start/end positions in the buffer.

zeertzjq added a commit to zeertzjq/neovim that referenced this issue May 19, 2024
Problem:  Cannot get a list of positions describing a region
          (Justin M. Keyes, after v9.1.0120)
Solution: Add the getregionpos() function
          (Shougo Matsushita)

fixes: vim/vim#14609
closes: vim/vim#14617

vim/vim@b4757e6

Co-authored-by: Shougo Matsushita <[email protected]>
Co-authored-by: Justin M. Keyes <[email protected]>
zeertzjq added a commit to zeertzjq/neovim that referenced this issue May 19, 2024
Problem:  Cannot get a list of positions describing a region
          (Justin M. Keyes, after v9.1.0120)
Solution: Add the getregionpos() function
          (Shougo Matsushita)

fixes: vim/vim#14609
closes: vim/vim#14617

vim/vim@b4757e6

Co-authored-by: Shougo Matsushita <[email protected]>
Co-authored-by: Justin M. Keyes <[email protected]>
zeertzjq added a commit to zeertzjq/neovim that referenced this issue May 20, 2024
Problem:  Cannot get a list of positions describing a region
          (Justin M. Keyes, after v9.1.0120)
Solution: Add the getregionpos() function
          (Shougo Matsushita)

fixes: vim/vim#14609
closes: vim/vim#14617

vim/vim@b4757e6

Co-authored-by: Shougo Matsushita <[email protected]>
Co-authored-by: Justin M. Keyes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant