[vim/vim] Fix cmdwin cursor position and prefix on wrapped lines (PR #19964)

2 views
Skip to first unread message

h_east

unread,
Apr 12, 2026, 7:21:17 PMApr 12
to vim/vim, Subscribed

When opening the command-line window with CTRL-F after typing a command that fills the screen width, the cursor was placed past the end of the line. Add check_cursor() after setting State to MODE_NORMAL so the cursor is adjusted to the last character.

Also fix the cmdwin prefix character (e.g. ':') being drawn on wrapped continuation rows. It should only appear on the first screen row of each buffer line.


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

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

Commit Summary

  • 7a61c5c Fix cmdwin cursor position and prefix on wrapped lines

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19964@github.com>

zeertzjq

unread,
Apr 12, 2026, 7:30:00 PMApr 12
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In src/drawline.c:

> @@ -2051,9 +2051,10 @@ win_line(
 	    if (wlv.draw_state == WL_CMDLINE - 1 && wlv.n_extra == 0)
 	    {
 		wlv.draw_state = WL_CMDLINE;
-		if (wp == cmdwin_win)
+		if (wp == cmdwin_win && wlv.row == wlv.startrow)

Shouldn't an empty space be drawn on continuation rows instead? Otherwise continuation rows will be offset by 1 cell to the left.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19964/review/4095847693@github.com>

h_east

unread,
Apr 12, 2026, 7:44:11 PMApr 12
to vim/vim, Subscribed

@h-east commented on this pull request.


In src/drawline.c:

> @@ -2051,9 +2051,10 @@ win_line(
 	    if (wlv.draw_state == WL_CMDLINE - 1 && wlv.n_extra == 0)
 	    {
 		wlv.draw_state = WL_CMDLINE;
-		if (wp == cmdwin_win)
+		if (wp == cmdwin_win && wlv.row == wlv.startrow)

Fair point.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19964/review/4095860965@github.com>

h_east

unread,
Apr 12, 2026, 7:54:02 PMApr 12
to vim/vim, Push

@h-east pushed 1 commit.

  • d63a231 Fix cmdwin cursor position and prefix on wrapped lines


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19964/before/9ca78a2ba4ceeee7a122a37f3ab6298dd1e94d23/after/d63a231b3a17f2e33dbafedfbb4d009bc3767c5a@github.com>

h_east

unread,
Apr 12, 2026, 9:07:34 PMApr 12
to vim/vim, Push

@h-east pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19964/before/d63a231b3a17f2e33dbafedfbb4d009bc3767c5a/after/e0e774c8b822f36a070c6ccf3f0edc993c92d34e@github.com>

Christian Brabandt

unread,
Apr 14, 2026, 12:56:28 PMApr 14
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19964)

thanks


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19964/c4245696427@github.com>

Christian Brabandt

unread,
Apr 14, 2026, 1:01:40 PMApr 14
to vim/vim, Subscribed

Closed #19964 via c4fe1e9.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19964/issue_event/24496923830@github.com>

Reply all
Reply to author
Forward
0 new messages