aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/cursor.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-27 20:04:44 +0800
committerGitHub <noreply@github.com>2023-08-27 20:04:44 +0800
commit1f49c980368616345d8d0e121fed66a2013f9e96 (patch)
tree0552d0baa97e3c23b447039eb4db340f67811afe /src/nvim/cursor.c
parent4c69279f97e566277a33b81146b26b7ca20de4f3 (diff)
downloadrneovim-1f49c980368616345d8d0e121fed66a2013f9e96.tar.gz
rneovim-1f49c980368616345d8d0e121fed66a2013f9e96.tar.bz2
rneovim-1f49c980368616345d8d0e121fed66a2013f9e96.zip
vim-patch:9.0.1792: problem with gj/gk/gM and virtual text (#24898)
Problem: Normal mode "gM", "gj", "gk" commands behave incorrectly with virtual text. Solution: Use linetabsize() instead of linetabsize_str(). closes: vim/vim#12909 https://github.com/vim/vim/commit/d809c0a90387a23aed21ba37d0b65332fb5dafe7
Diffstat (limited to 'src/nvim/cursor.c')
-rw-r--r--src/nvim/cursor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/cursor.c b/src/nvim/cursor.c
index 2dc903309e..418d49dfeb 100644
--- a/src/nvim/cursor.c
+++ b/src/nvim/cursor.c
@@ -115,7 +115,7 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a
col = wcol;
if ((addspaces || finetune) && !VIsual_active) {
- curwin->w_curswant = linetabsize_str(line) + one_more;
+ curwin->w_curswant = (int)linetabsize(curwin, pos->lnum) + one_more;
if (curwin->w_curswant > 0) {
curwin->w_curswant--;
}
@@ -129,7 +129,7 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a
&& curwin->w_width_inner != 0
&& wcol >= (colnr_T)width
&& width > 0) {
- csize = linetabsize_str(line);
+ csize = (int)linetabsize(curwin, pos->lnum);
if (csize > 0) {
csize--;
}