vim-patch:9.1.0430: getregionpos() doesn't handle one char selection (#28924)

Problem:  getregionpos() doesn't handle one char selection.
Solution: Handle startspaces differently when is_oneChar is set.
          Also add a test for an exclusive charwise selection with
          multibyte chars (zeertzjq)

closes: vim/vim#14825

52a6f34887
This commit is contained in:
zeertzjq
2024-05-23 06:08:24 +08:00
committed by GitHub
parent 3d43bdc81e
commit 5cbd6d9b9f
6 changed files with 81 additions and 17 deletions

View File

@@ -4433,8 +4433,8 @@ M.funcs = {
the offset in screen columns from the start of the character.
E.g., a position within a <Tab> or after the last character.
If the "off" number of an ending position is non-zero, it is
the character's number of cells included in the selection,
otherwise the whole character is included.
the offset of the character's first cell not included in the
selection, otherwise all its cells are included.
]=],
name = 'getregionpos',
params = { { 'pos1', 'table' }, { 'pos2', 'table' }, { 'opts', 'table' } },