Shougo / dpp-ext-lazy

Lazy ext for dpp.vim
MIT License
6 stars 1 forks source link

Setting string value for `on_map` fails dummy mapping generation #2

Closed tgw314 closed 1 year ago

tgw314 commented 1 year ago

Problems summary

Setting string value for on_map fails dummy mapping generation.

Expected

Dummy mapping generation does not fail even when a string value is set for the on_map.

Environment Information

Provide a minimal init.vim/vimrc without plugin managers (Required!)

let $DPP_DIR = stdpath("data") . '/dpp'

execute 'set runtimepath+=' . $DPP_DIR . '/repos/github.com/Shougo/dpp.vim'
execute 'set runtimepath+=' . $DPP_DIR . '/repos/github.com/Shougo/dpp-ext-lazy'
execute 'set runtimepath+=' . $DPP_DIR . '/repos/github.com/vim-denops/denops.vim'

autocmd User DenopsReady call dpp#make_state($DPP_DIR, stdpath("config") . '/config.ts')
import {
  BaseConfig,
  ConfigReturn,
  ContextBuilder,
  Dpp,
  Plugin,
} from "https://deno.land/x/dpp_vim@v0.0.7/types.ts";
import { Denops, fn } from "https://deno.land/x/dpp_vim@v0.0.7/deps.ts";

export class Config extends BaseConfig {
  override async config(args: {
    denops: Denops;
    contextBuilder: ContextBuilder;
    basePath: string;
    dpp: Dpp;
  }): Promise<ConfigReturn> {
    const [context, options] = await args.contextBuilder.get(args.denops);

    await args.dpp.extAction(
      args.denops,
      context,
      options,
      "lazy",
      "makeState",
      {
        plugins: [{
          name: "dpp.vim",
          path: await fn.expand(
            args.denops,
            "$DPP_DIR/repos/github.com/Shougo/dpp.vim",
          ),
          on_map: "j",
        }],
      },
    );

    return {
      plugins: [] as Plugin[],
    };
  }
}

How to reproduce the problem from neovim/Vim startup (Required!)

  1. Place these files in $XDG_CONFIG_HOME/nvim-minimal/
  2. Run NVIM_APPNAME=nvim-minimal nvim

Screenshot (if possible)

Upload the log messages by :redir and :message (if errored)

[denops] Failed to handle message 2,invoke,dispatch,dpp,makeState,/home/{username}/.local/share/nvim-minimal/dpp,/home/{username}/.config/nvim-minimal/config.ts,nvim 0,function dpp#ext#lazy#_generate_dummy_mappings, line 7: Vim(let):E928: String required
Shougo commented 1 year ago

Fixed.