[vim/vim] mbyte: wrong cell count for an overlong UTF-8 sequence (PR #21005)

h_east (Vim Github Repository) <[email protected]> Tue, 11 Aug 2026 02:54:32 -0700
Newsgroups gmane.editors.vim.devel
Message-ID <vim/vim/pull/[email protected]>
```
Problem:  An overlong UTF-8 encoding of an unprintable ASCII character is
          displayed as <xx> but counted as two screen cells, so that the
          cursor ends up in the wrong position when editing the line.
Solution: Count four cells for an unprintable overlong sequence.
```

fixes: #20988
You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/21005

-- Commit Summary --

  * mbyte: wrong cell count for an overlong UTF-8 sequence

-- File Changes --

    M src/mbyte.c (10)
    M src/testdir/test_utf8.vim (20)

-- Patch Links --

https://github.com/vim/vim/pull/21005.patch
https://github.com/vim/vim/pull/21005.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/pull/21005
You are receiving this because you are subscribed to this thread.

Message ID: <vim/vim/pull/[email protected]>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/pull/21005%40github.com.