From a7f44375bc569e1349c3f37c345c7bee365c9417 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Tue, 23 Jul 2024 18:28:28 +0900 Subject: [PATCH] Fix dummy_commands and dummy_mappings --- autoload/dpp/min.vim | 2 +- autoload/dpp/source.vim | 6 +++--- denops/dpp/deps.ts | 3 +-- denops/dpp/types.ts | 2 +- doc/dpp.txt | 2 ++ 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/autoload/dpp/min.vim b/autoload/dpp/min.vim index 53ea7bc..88effc6 100644 --- a/autoload/dpp/min.vim +++ b/autoload/dpp/min.vim @@ -20,7 +20,7 @@ function dpp#min#load_state(path, name=v:progname->fnamemodify(':r')) abort endtry endfunction function dpp#min#_init() abort - const g:dpp#_state_version = 2 + const g:dpp#_state_version = 3 const g:dpp#_is_sudo = $SUDO_USER !=# '' && $USER !=# $SUDO_USER \ && $HOME !=# ('~'.$USER)->expand() \ && $HOME ==# ('~'.$SUDO_USER)->expand() diff --git a/autoload/dpp/source.vim b/autoload/dpp/source.vim index 81ab981..e66854f 100644 --- a/autoload/dpp/source.vim +++ b/autoload/dpp/source.vim @@ -166,14 +166,14 @@ function s:source_plugin(rtps, index, plugin, sourced) abort if a:plugin->has_key('dummy_commands') for command in a:plugin.dummy_commands - silent! execute 'delcommand' command[0] + silent! execute 'delcommand' command endfor let a:plugin.dummy_commands = [] endif if a:plugin->has_key('dummy_mappings') - for map in a:plugin.dummy_mappings - silent! execute map[0].'unmap' map[1] + for [mode, map] in a:plugin.dummy_mappings + execute mode..'unmap' map endfor let a:plugin.dummy_mappings = [] endif diff --git a/denops/dpp/deps.ts b/denops/dpp/deps.ts index 3a96f31..758b841 100644 --- a/denops/dpp/deps.ts +++ b/denops/dpp/deps.ts @@ -24,8 +24,7 @@ export { parse, SEPARATOR as pathsep, toFileUrl, -} from "jsr:@std/path@1.0.0"; -export { deadline, DeadlineError } from "jsr:@std/async@0.224.2"; +} from "jsr:@std/path@1.0.1"; export { Lock } from "jsr:@lambdalisue/async@2.1.1"; export { ensure, is } from "jsr:@core/unknownutil@3.18.1"; diff --git a/denops/dpp/types.ts b/denops/dpp/types.ts index 9de059d..99eb3b1 100644 --- a/denops/dpp/types.ts +++ b/denops/dpp/types.ts @@ -87,7 +87,7 @@ export type Plugin = { build?: string; depends?: string | string[]; dummy_commands?: string[]; - dummy_mappings?: string[]; + dummy_mappings?: [string, string][]; frozen?: boolean; ftplugin?: Record; hook_add?: string; diff --git a/doc/dpp.txt b/doc/dpp.txt index e2c0a5f..96a8ba9 100644 --- a/doc/dpp.txt +++ b/doc/dpp.txt @@ -316,6 +316,7 @@ name (String) on_cmd (List) or (String) If it is matched to the executed command name, dpp will call |dpp#source()|. + NOTE: It must be unique. NOTE: To use the feature, you need to install "dpp-ext-lazy". https://github.com/Shougo/dpp-ext-lazy @@ -380,6 +381,7 @@ on_map (Dictionary) or (List) or (String) NOTE: You can use plugin prefix mappings. For example, you can use "(ref-" instead of "(ref-back)" and so on. + NOTE: It must be unique. NOTE: To use the feature, you need to install "dpp-ext-lazy". https://github.com/Shougo/dpp-ext-lazy