import { echo } from "https://deno.land/x/denops_std@v6.1.0/helper/echo.ts";
Echo message as like echo
on Vim script.
Vim (not Neovim) won't show message posted from a channel command and Vim won't pause multiline message posted from timer. This function applied some workaround to show message posted from a channel command, and pause if the message is multiline.
Note that it does nothing and return immediately when denops is running as 'test' mode to avoid unwilling test failures.
import type { Denops } from "https://deno.land/x/denops_std@v6.1.0/mod.ts";
import { echo } from "https://deno.land/x/denops_std@v6.1.0/helper/echo.ts";
export async function main(denops: Denops): Promise<void> {
await echo(denops, "Hello\nWorld!");
}
WARNING
In order to make the behavior of Vim and Neovim consistent,
timer_start()
is used internally not only in Vim but also in
Neovim. Note that this means that you cannot control the message
by prepending silent
when calling it from the Vim script.
If you want to control the message, use the setSilent
function
to change the silent state to 'silent'
or 'silent!'
in
advance, or use the ensureSilent
function to fix the silent state
to 'silent'
or 'silent!'
during execution of any function.