deno-denops-std icon indicating copy to clipboard operation
deno-denops-std copied to clipboard

It seems `helper/echo` is no longer required in the latest Vim

Open lambdalisue opened this issue 2 years ago • 1 comments

Originally, the helper/echo function was designed as a workaround for a the following limitation in Vim.

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.

However, it appears that test1 functions effectively in the latest version of Vim, indicating that we may no longer need helper/echo, which internally utilizes timer_start (hence, somewhat delicate).

I aim to pinpoint the specific commits in Vim that resolved this issue, enabling us to decide whether the function is indeed dispensable or should be retained.

Tested with

import type { Denops } from "https://deno.land/x/[email protected]/mod.ts";
import { echo } from "https://deno.land/x/[email protected]/helper/mod.ts";

export function main(denops: Denops): void {
  const message = "Hello\nWorld\nGoodbye\nWorld";

  denops.dispatcher = {
    async test1() {
      await denops.cmd(`echo message`, { message });
    },
    async test2() {
      await echo(denops, message);
    },
  };
}

Then

:call denops#request('my-test', 'test1', [])
:call denops#request('my-test', 'test2', [])

lambdalisue avatar Nov 05 '23 13:11 lambdalisue

May related

  • https://github.com/vim/vim/issues/8494
  • https://github.com/vim/vim/issues/3960

lambdalisue avatar Nov 05 '23 13:11 lambdalisue