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

1 view
Skip to first unread message

h_east

unread,
7:21 PM (2 hours ago) 7:21 PM
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,
7:30 PM (2 hours ago) 7:30 PM
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,
7:44 PM (1 hour ago) 7:44 PM
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,
7:54 PM (1 hour ago) 7:54 PM
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,
9:07 PM (1 minute ago) 9:07 PM
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>

Reply all
Reply to author
Forward
0 new messages