> Help for :map-<silent> says that with <silent>, the right side of > a mapping will not be echoed on the command line, but messages from > the executed command are still given. This works with :nmap but not > with :vmap. I would expect it to work with :vmap as well. > > Steps to reproduce > > 1. Put the following in a file, say foo.vim. > > nmap <silent> gx :call DebugSilent()<CR> > vmap <silent> gx :call DebugSilent()<CR> > function DebugSilent() > echomsg "from DebugSilent" > endfunction > > 2. Start vim and source that file. > > $ vim -N --clean > :so foo.vim > > 3. Enter some word into the current buffer. > > 4. Visually select that word. > > viw > > 5. Type the mapping. > > gx > > 6. Note that no message appears, or just flashes by briefly. > > 7. Execute :messages to verify that the message was generated and > saved in message history. > > 8. Without visually selecting the word, type the mapping. > > gx > > 9. Note that the message does appear in the command line and > remains there. > > Expected behavior > > I expect the message to remain in the command line after the > execution of the vmap just as it does for a normal map.
It appears to work as you expect when 'cmdheight' is 2 or more. Most likely the message is cleared when the "-- VISUAL --" mode message is removed. Setting 'noshowmode' helps. This should not happen though, when the message overwrites the mode then there is no need later to clear the mode message. -- If Microsoft would build a car... ... The airbag system would ask "are you SURE?" before deploying. /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- 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 vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/20230615153522.738AB1C0D56%40moolenaar.net.