Skip to content

Add functions to set/get cursor and mark position using character count#7648

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

Add functions to set/get cursor and mark position using character count#7648
yegappan wants to merge 1 commit intovim:masterfrom
yegappan:excmdtest

Conversation

@yegappan
Copy link
Member

@yegappan yegappan commented Jan 9, 2021

Add the following functions:

getcharpos() - Get the character position of the cursor or a mark. For non multibyte text, same as getpos().
setcharpos() - Set the character position of the cursor or a mark. For non multibyte text, same as setpos().
charcol() - Get the character count of the cursor or a mark in a line. For non multibyte text, same as col().
getcursorcharpos() - Get the character position of the cursor. For non multibyte text, same as getcurpos().
setcursorcharpos() - Set the character position of the cursor. For non multibyte text, same as cursor().

@codecov
Copy link

codecov bot commented Jan 9, 2021

Codecov Report

Merging #7648 (ba1275f) into master (cff40ff) will decrease coverage by 0.10%.
The diff coverage is 92.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7648      +/-   ##
==========================================
- Coverage   88.99%   88.88%   -0.11%     
==========================================
  Files         148      148              
  Lines      164050   161968    -2082     
==========================================
- Hits       145989   143969    -2020     
+ Misses      18061    17999      -62     
Flag Coverage Δ
huge-clang-none 86.09% <100.00%> (-1.93%) ⬇️
huge-gcc-none 88.40% <92.71%> (-0.01%) ⬇️
huge-gcc-testgui 86.91% <92.71%> (-0.01%) ⬇️
huge-gcc-unittests 2.48% <0.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
src/eval.c 96.15% <88.88%> (-0.15%) ⬇️
src/evalfunc.c 95.91% <94.23%> (-0.09%) ⬇️
src/tag.c 93.94% <100.00%> (ø)
src/typval.c 96.75% <100.00%> (+0.10%) ⬆️
src/help.c 89.76% <0.00%> (-1.08%) ⬇️
src/textobject.c 91.69% <0.00%> (-0.71%) ⬇️
src/ops.c 91.80% <0.00%> (-0.57%) ⬇️
src/clipboard.c 82.90% <0.00%> (-0.55%) ⬇️
src/ex_cmds2.c 90.68% <0.00%> (-0.54%) ⬇️
src/move.c 93.60% <0.00%> (-0.54%) ⬇️
... and 92 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 cff40ff...ba1275f. Read the comment docs.

@Shane-XB-Qian

This comment was marked as off-topic.

@Shane-XB-Qian

This comment was marked as off-topic.

@vim-ml
Copy link

vim-ml commented Jan 16, 2021 via email

@Shane-XB-Qian

This comment was marked as off-topic.

@Shane-XB-Qian

This comment was marked as off-topic.

zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Jan 13, 2022
…ter count

Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
vim/vim@6f02b00
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Jan 13, 2022
…ter count

Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
vim/vim@6f02b00
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Jan 13, 2022
…ter count

Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
vim/vim@6f02b00
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Jan 14, 2022
…ter count

Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
vim/vim@6f02b00
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Jan 14, 2022
…ter count

Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
vim/vim@6f02b00
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Jan 29, 2022
…ter count

Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
vim/vim@6f02b00
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Jan 29, 2022
…ter count

Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
vim/vim@6f02b00
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Jan 29, 2022
…ter count

Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
vim/vim@6f02b00
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Feb 4, 2022
…ter count

Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
vim/vim@6f02b00
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Feb 4, 2022
…ter count

Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
vim/vim@6f02b00
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Feb 4, 2022
…ter count

Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
vim/vim@6f02b00
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Feb 4, 2022
…ter count

Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
vim/vim@6f02b00
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Feb 5, 2022
…ter count

Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
vim/vim@6f02b00
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Feb 5, 2022
…ter count

Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
vim/vim@6f02b00
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Feb 5, 2022
…ter count

Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
vim/vim@6f02b00
zbirenbaum pushed a commit to zbirenbaum/neovim that referenced this pull request Feb 11, 2022
…ter count

Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
            closes vim/vim#7648)
vim/vim@6f02b00
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.

3 participants