Commit: tests(commondumps): Use character counts when marking columns

0 views
Skip to first unread message

Christian Brabandt

unread,
May 18, 2026, 3:15:17 PM (10 hours ago) May 18
to vim...@googlegroups.com
tests(commondumps): Use character counts when marking columns

Commit: https://github.com/vim/vim/commit/e543abbf8e764d701575428461126129476e93c1
Author: Aliaksei Budavei <0x00...@gmail.com>
Date: Mon May 18 19:07:08 2026 +0000

tests(commondumps): Use character counts when marking columns

Continue using "strwidth" when calculating the position of
a column of interest, and start using "setcharpos" when
marking a line of interest so that paired-up marks remain
aligned columnwise across all three parts generated by
"term_dumpdiff", especially when multibyte characters are
written in the line before the marked column.

closes: #20237

Signed-off-by: Aliaksei Budavei <0x00...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/testdir/commondumps.vim b/src/testdir/commondumps.vim
index 27d59bcdd..40206041b 100644
--- a/src/testdir/commondumps.vim
+++ b/src/testdir/commondumps.vim
@@ -10,7 +10,7 @@ enddef
def TryChangingLastJumpMark(marks: dict<list<number>>)
const pos: list<number> = get(marks, line('.'), [])
if !empty(pos)
- setpos("'`", pos)
+ setcharpos("'`", pos)
endif
enddef

@@ -56,7 +56,7 @@ def FoldAndMarkDumpDiffParts(letters: list<string>)
var marks: dict<list<number>> = {}
for idx in range(parts[1]->len())
if !empty(letters)
- setpos(("'" .. remove(letters, 0)), parts[1][idx])
+ setcharpos(("'" .. remove(letters, 0)), parts[1][idx])
endif
# Point "bs" to "cs", "cs" to "as", "as" to "cs".
marks[parts[1][idx][1]] = parts[2][idx]
Reply all
Reply to author
Forward
0 new messages