Skip to content

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

@lambdalisue

Description

@lambdalisue

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/denops_std@v5.0.0/mod.ts";
import { echo } from "https://deno.land/x/denops_std@v5.0.0/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', [])

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