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

vim-patch:9.1.{0394,0395,0423}: getregionpos() #28854

Merged
merged 3 commits into from
May 20, 2024

Conversation

zeertzjq
Copy link
Member

@zeertzjq zeertzjq commented May 19, 2024

vim-patch:9.1.0394: Cannot get a list of positions describing a region

Problem: Cannot get a list of positions describing a region
(Justin M. Keyes, after v9.1.0120)
Solution: Add the getregionpos() function
(Shougo Matsushita)

closes: vim/vim#14617

vim/vim@b4757e6

Co-authored-by: Shougo Matsushita Shougo.Matsu@gmail.com
Co-authored-by: Justin M. Keyes justinkz@gmail.com

vim-patch:9.1.0395: getregionpos() may leak memory on error

Problem: regionpos may leak memory on error, coverity
complains about dereferencing Null pointer
Solution: free all list pointers (after v9.1.394),
return early if buflist_findnr() returns NULL

closes: vim/vim#14731

vim/vim@b8ecedc

Co-authored-by: Christian Brabandt cb@256bit.org

vim-patch:9.1.0423: getregionpos() wrong with blockwise mode and multibyte

Problem: getregionpos() wrong with blockwise mode and multibyte.
Solution: Use textcol and textlen instead of start_vcol and end_vcol.
Handle coladd properly (zeertzjq).

Also remove unnecessary buflist_findnr() in add_regionpos_range(), as
getregionpos() has already switched buffer.

closes: vim/vim#14805

vim/vim@c95e64f

@github-actions github-actions bot added the vim-patch See https://neovim.io/doc/user/dev_vimpatch.html label May 19, 2024
@zeertzjq zeertzjq changed the title vim-patch:9.1.0394,9.1.0395 vim-patch:9.1.{0394,0395}: getregionpos() May 19, 2024
@github-actions github-actions bot requested a review from seandewar May 19, 2024 22:48
@zeertzjq zeertzjq marked this pull request as draft May 19, 2024 23:08
@github-actions github-actions bot removed the request for review from seandewar May 19, 2024 23:08
zeertzjq and others added 2 commits May 20, 2024 20:50
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 <Shougo.Matsu@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Problem:  regionpos may leak memory on error, coverity
          complains about dereferencing Null pointer
Solution: free all list pointers (after v9.1.394),
          return early if buflist_findnr() returns NULL

closes: vim/vim#14731

vim/vim@b8ecedc

Co-authored-by: Christian Brabandt <cb@256bit.org>
@zeertzjq zeertzjq changed the title vim-patch:9.1.{0394,0395}: getregionpos() vim-patch:9.1.{0394,0395,0423}: getregionpos() May 20, 2024
@zeertzjq zeertzjq marked this pull request as ready for review May 20, 2024 12:58
@github-actions github-actions bot requested a review from seandewar May 20, 2024 12:58
…ibyte

Problem:  getregionpos() wrong with blockwise mode and multibyte.
Solution: Use textcol and textlen instead of start_vcol and end_vcol.
          Handle coladd properly (zeertzjq).

Also remove unnecessary buflist_findnr() in add_regionpos_range(), as
getregionpos() has already switched buffer.

closes: vim/vim#14805

vim/vim@c95e64f
@zeertzjq zeertzjq merged commit 36a9da6 into neovim:master May 20, 2024
29 checks passed
@zeertzjq zeertzjq deleted the vim-9.1.0394 branch May 20, 2024 13:17
@github-actions github-actions bot removed the request for review from seandewar May 20, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vim-patch See https://neovim.io/doc/user/dev_vimpatch.html
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant