[vim/vim] textprop: wrong cursor line with truncated virtual text below an empty line (PR #20917)

h_east (Vim Github Repository) <[email protected]> Sun, 02 Aug 2026 00:45:04 -0700
Newsgroups gmane.editors.vim.devel
Message-ID <vim/vim/pull/[email protected]>

----==_mimepart_6a6ef580a5375_ec1160612016d
Content-Type: text/plain; charset="UTF-8"

```
Problem:  The cursor is displayed in the wrong line when virtual text below
          an empty line is truncated.
Solution: Do not count an extra column for an empty line that has virtual
          text below it, its width already includes filling up the line.
```
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * textprop: wrong cursor line with truncated virtual text below an empty line

-- File Changes --

    M runtime/doc/todo.txt (1)
    M src/charset.c (12)
    M src/structs.h (2)
    M src/testdir/test_textprop.vim (21)

-- Patch Links --

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

-- 
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/pull/20917
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/20917%40github.com.

----==_mimepart_6a6ef580a5375_ec1160612016d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<pre class=3D"notranslate"><code class=3D"notranslate">Problem:  The cursor=
 is displayed in the wrong line when virtual text below
          an empty line is truncated.
Solution: Do not count an extra column for an empty line that has virtual
          text below it, its width already includes filling up the line.
</code></pre>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>&nbsp;&nbsp;<a href=3D'https://github.com/vim/vim/pull/20917'>https://gi=
thub.com/vim/vim/pull/20917</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href=3D"https://github.com/vim/vim/pull/20917/commits/bf9c6cd90028=
5b20c9a570bc49066eef4b1c5589" class=3D"commit-link">bf9c6cd</a>  textprop: =
wrong cursor line with truncated virtual text below an empty line</li>
</ul>

<h4 style=3D"display: inline-block">File Changes </h4> <p style=3D"display:=
 inline-block">(<a href=3D"https://github.com/vim/vim/pull/20917/files">4&n=
bsp;files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href=3D"https://github.com/vim/vim/pull/20917/files#diff-fb7eed53e3f=
2993f9d82c748206eaca82fd1d054a417c6de477bb54373d85643">runtime/doc/todo.txt=
</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href=3D"https://github.com/vim/vim/pull/20917/files#diff-c4d3af906cf=
f00cb5069b56dcf52a5b54e6f99ba0a32b37f48376eb4700d91d0">src/charset.c</a>
    (12)
  </li>
  <li>
    <strong>M</strong>
    <a href=3D"https://github.com/vim/vim/pull/20917/files#diff-6500c47e4af=
abd64a8cb2f853a4bc5e8c33f43814d3f9a0a9f4371025578a798">src/structs.h</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href=3D"https://github.com/vim/vim/pull/20917/files#diff-745bc1c7b61=
0a2e3c8047963b62119afca683765e872558fa6d14fe4c745fa38">src/testdir/test_tex=
tprop.vim</a>
    (21)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href=3D'https://github.com/vim/vim/pull/20917.patch'>https://githu=
b.com/vim/vim/pull/20917.patch</a></li>
  <li><a href=3D'https://github.com/vim/vim/pull/20917.diff'>https://github=
.com/vim/vim/pull/20917.diff</a></li>
</ul>

<p style=3D"font-size:small;-webkit-text-size-adjust:none;color:#666;">&mda=
sh;<br />Reply to this email directly, <a href=3D"https://github.com/vim/vi=
m/pull/20917">view it on GitHub</a>, or <a href=3D"https://github.com/notif=
ications/unsubscribe-auth/ACY5DGCEV6KEUAUH5QZKNJL5H3WQBAVCNFSNUABEKJSXA33TN=
F2G64TZHM2DAOJZG42DQMR3JFZXG5LFHM2TANBRGM2TQOBUGOQXMAQ">unsubscribe</a>.<br=
 />Triage notifications, keep track of coding agent tasks and review pull r=
equests on the go with GitHub Mobile for <a href=3D"https://github.com/noti=
fications/mobile/ios/ACY5DGG6PMRGASCZ77L6F5L5H3WQBA5CNFSNUABEM5UWIORPF5TWS5=
BNNB2WEL2QOVWGYUTFOF2WK43UF42DCOBXGM4DMOBWG2THEZLBONXW5KTTOVRHGY3SNFRGKZFFM=
V3GK3TUVJTG633UMVZF62LPOM">iOS</a> and <a href=3D"https://github.com/notifi=
cations/mobile/android/ACY5DGBEO73TBKQA6WFRWDT5H3WQBA5CNFSNUABEM5UWIORPF5TW=
S5BNNB2WEL2QOVWGYUTFOF2WK43UF42DCOBXGM4DMOBWG2THEZLBONXW5KTTOVRHGY3SNFRGKZF=
FMV3GK3TUVZTG633UMVZF6YLOMRZG62LE">Android</a>. Download it today!
<br />You are receiving this because you are subscribed to this thread.<img=
 src=3D"https://github.com/notifications/beacon/ACY5DGHYDHQXRIHSHEVTGVL5H3W=
QBBFCNFSM6AAAAAC4WQAMC6WGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHQAA=
AAAEWH2B73UZZGKYLTN5XKU43VMJZWG4TJMJSWI.gif" height=3D"1" width=3D"1" alt=
=3D"" /><span style=3D"color: transparent; font-size: 0; display: none; vis=
ibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-wid=
th: 0; max-height: 0; mso-hide: all">Message ID: <span>&lt;vim/vim/pull/209=
17</span><span>@</span><span>github</span><span>.</span><span>com&gt;</span=
></span></p>
<script type=3D"application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/vim/vim/pull/20917",
"url": "https://github.com/vim/vim/pull/20917",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>

<p></p>

-- <br />
-- <br />
You received this message from the &quot;vim_dev&quot; maillist.<br />
Do not top-post! Type your reply below the text you are replying to.<br />
For more information, visit <a href=3D"http://www.vim.org/maillist.php">htt=
p://www.vim.org/maillist.php</a><br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;vim_dev&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">vim_dev+uns=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
vim_dev/vim/vim/pull/20917%40github.com?utm_medium=3Demail&utm_source=3Dfoo=
ter">https://groups.google.com/d/msgid/vim_dev/vim/vim/pull/20917%40github.=
com</a>.<br />

----==_mimepart_6a6ef580a5375_ec1160612016d--