Skip to content

wildtrigger() might silently set v:errmsg #18825

@echasnovski

Description

@echasnovski

Steps to reproduce

  1. Create an 'init.vim' file with the variation of content from :h cmdline-autocompletion:

    let g:log = []
    autocmd CmdlineChanged [:\/\?] call wildtrigger() | let g:log = g:log + [[getcmdline(), v:errmsg]]
    set wildmode=noselect:lastused,full
    set wildoptions=pum
  2. vim --clean -u init.vim

  3. Type :tag<Space><Space>. There is no error shown, but the v:errmsg is set to E433: No tags file. It can be verified later by :echo g:log which contains an entry ['tag ', 'E433: No tags file'].

    Pressing <Esc> shows an error E73: Tag stack empty, but it is the same behavior as without wildtrigger() autocompletion.

Expected behaviour

Calling wildtrigger() never silently sets v:errmsg. Only if that message is actually shown.

Version of Vim

9.1.1908

Environment

OS: EndeavourOS Linux x86_64, 6.17.8-arch1-1
Terminal: Ghostty 1.2.3-arch2
Value of $TERM: xterm-ghostty
Shell: nushell 0.108.0

Logs and stack traces

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions