Skip to content

Add the virtcol2col() function#10477

Closed
yegappan wants to merge 1 commit intovim:masterfrom
yegappan:excmdtest
Closed

Add the virtcol2col() function#10477
yegappan wants to merge 1 commit intovim:masterfrom
yegappan:excmdtest

Conversation

@yegappan
Copy link
Member

Addresses the request made in #10098.

@codecov
Copy link

codecov bot commented May 25, 2022

Codecov Report

Merging #10477 (f11fbb2) into master (e0ff3a7) will increase coverage by 0.00%.
The diff coverage is 88.23%.

@@           Coverage Diff           @@
##           master   #10477   +/-   ##
=======================================
  Coverage   81.67%   81.68%           
=======================================
  Files         158      158           
  Lines      185154   185171   +17     
  Branches    41880    41884    +4     
=======================================
+ Hits       151233   151250   +17     
+ Misses      21469    21465    -4     
- Partials    12452    12456    +4     
Flag Coverage Δ
huge-clang-none 82.57% <88.23%> (-0.01%) ⬇️
linux 82.57% <88.23%> (-0.01%) ⬇️
mingw-x64-HUGE 0.00% <0.00%> (ø)
mingw-x64-HUGE-gui 78.10% <85.71%> (+<0.01%) ⬆️
windows 76.88% <85.71%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/evalfunc.c 90.72% <ø> (ø)
src/move.c 89.91% <88.23%> (-0.03%) ⬇️
src/gui_gtk_f.c 93.30% <0.00%> (-0.71%) ⬇️
src/message.c 80.45% <0.00%> (-0.24%) ⬇️
src/term.c 73.29% <0.00%> (-0.21%) ⬇️
src/gui_gtk_x11.c 52.11% <0.00%> (-0.05%) ⬇️
src/popupwin.c 87.29% <0.00%> (-0.05%) ⬇️
src/channel.c 83.80% <0.00%> (ø)
src/os_win32.c 56.91% <0.00%> (+0.03%) ⬆️
src/gui.c 73.21% <0.00%> (+0.13%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e0ff3a7...f11fbb2. Read the comment docs.

@brammool
Copy link
Contributor

brammool commented May 25, 2022 via email

@yegappan
Copy link
Member Author

It would be good (but more work) to check a wrapping line with 'breakindent' set.
Could add this in test_breakindent.vim somewhere.

Currently the screenpos2col() function takes the buffer line number and the
screen column number and returns the buffer column number (byte offset).
Should we change this so that the function takes the screen line number
and screen column number and returns the buffer column number?
In this case, it will work only if the specified line is visible in a window.

@zeertzjq
Copy link
Member

Looking at the implementation, maybe this function name can be changed to virtcol2col()?

@vim-ml
Copy link

vim-ml commented May 26, 2022 via email

@brammool
Copy link
Contributor

brammool commented May 26, 2022 via email

@yegappan yegappan force-pushed the excmdtest branch 2 times, most recently from 0410590 to f0e5f15 Compare May 27, 2022 17:08
@yegappan yegappan changed the title Add the screenpos2col() function Add the virtcol2col() function May 27, 2022
@brammool brammool closed this in 5a6ec10 May 27, 2022
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Sep 12, 2022
…ual column

Problem:    There is no way to get the byte index from a virtual column.
Solution:   Add virtcol2col(). (Yegappan Lakshmanan, closes vim/vim#10477,
            closes vim/vim#10098)
vim/vim@5a6ec10

Cherry-pick tv_check_for_number_arg() from Vim.
Cherry-pick pathshorten() doc change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants