On 2023-09-13, Ernie Rael wrote:
> Greetings,
> 
> In a plugin I'm working on, when certain simple errors occur, I want to ring
> the bell, some kind of alert. A popup, use in some place in the plugin, is 
> more
> than is needed.
> 
> The closest thing I can find is
> 
>     call sound_playevent('bell')
> 
> which isn't cross platform.
> 
> What have I missed?

I use

    normal \<Esc>

but I don't know how cross-platform it is.  It's documented at

    :help :echoerr

You don't have to use :exe.  I surround it with a test for
'errorbells', e.g.,

    if &errorbells
        normal \<Esc> " Generate a bell
    endif
    echohl ErrorMsg
    echomsg "Oops!"
    echohl None

Regards,
Gary

-- 
-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230913174857.GD2657%40phoenix.

Raspunde prin e-mail lui