[vim/vim] Fix wrapped cmdline truncated with wildoptions=pum and wildtrigger() autocmd (PR #20081)

3 views
Skip to first unread message

mattn

unread,
Apr 26, 2026, 11:13:22 PM (5 days ago) Apr 26
to vim/vim, Subscribed

With set wildoptions=pum and an autocmd such as autocmd CmdlineChanged [:\/\?] call wildtrigger(), typing enough characters to wrap the command line over multiple rows did not scroll the screen up; the cmdline stayed truncated on a single row.

redrawcmd() calls msg_start() which only forwards to msg_starthere() when !msg_didany || lines_left < 0. In the autocmd-driven popup refresh path redrawcmd() runs on every keystroke without msg_didany ever being reset, so lines_left decrements monotonically until it reaches 0. After that the msg_no_more && lines_left == 0 check in msg_puts_display() aborts drawing as soon as the cmdline overflows the current row, hiding the wrapped portion.

Call msg_starthere() explicitly at the start of redrawcmd() so lines_left is reset and the cmdline wraps and scrolls the screen the way it does when wildoptions=pum is not set.

Reproduce with:

set wildmenu
set wildmode=noselect:lastused,full
set wildoptions=pum
augroup vimrc_wildtrigger
  autocmd!
  autocmd CmdlineChanged [:\/\?] call wildtrigger()
augroup END

Then :e followed by a long run of spaces. Before this patch the cmdline freezes on the last row; after the patch it wraps and the buffer scrolls up.


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

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

Commit Summary

  • 26b4adc Fix wrapped cmdline truncated with wildoptions=pum and wildtrigger() autocmd

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20081@github.com>

Christian Brabandt

unread,
Apr 29, 2026, 2:25:50 PM (2 days ago) Apr 29
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#20081)

Thanks, can you add a test for the wrapping behaviour? I guess a screendump should work


Reply to this email directly, view it on GitHub, or unsubscribe.

Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20081/c4346411294@github.com>

mattn

unread,
Apr 29, 2026, 2:44:31 PM (2 days ago) Apr 29
to vim/vim, Push

@mattn pushed 1 commit.

  • 968f341 Add screendump test for wrapped cmdline with wildtrigger()


View it on GitHub or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20081/before/d5ef13b4bb5dc6ffeaff938ddde44b4bdc6e2469/after/968f34198c93fcfca5ad0d72690ceefc8d6e6996@github.com>

mattn

unread,
Apr 30, 2026, 1:41:50 AM (yesterday) Apr 30
to vim/vim, Subscribed
mattn left a comment (vim/vim#20081)

Thank you. Added test.


Reply to this email directly, view it on GitHub, or unsubscribe.

Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20081/c4349971343@github.com>

Christian Brabandt

unread,
9:26 AM (4 hours ago) 9:26 AM
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#20081)

Thanks. It looks like Commit 2 fixes a slightly different issue, so let me split your PR into 2 separate patches.


Reply to this email directly, view it on GitHub, or unsubscribe.

Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20081/c4359482673@github.com>

Christian Brabandt

unread,
9:36 AM (3 hours ago) 9:36 AM
to vim/vim, Subscribed

Closed #20081 via ec8b8bd.


Reply to this email directly, view it on GitHub, or unsubscribe.

Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20081/issue_event/25071244411@github.com>

Reply all
Reply to author
Forward
0 new messages