Skip to content

Commit

Permalink
Fix dummy_commands and dummy_mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Jul 23, 2024
1 parent b689473 commit a7f4437
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion autoload/dpp/min.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions autoload/dpp/source.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions denops/dpp/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
2 changes: 1 addition & 1 deletion denops/dpp/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string>;
hook_add?: string;
Expand Down
2 changes: 2 additions & 0 deletions doc/dpp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -380,6 +381,7 @@ on_map (Dictionary) or (List) or (String)
NOTE: You can use plugin prefix mappings.
For example, you can use "<Plug>(ref-" instead of
"<Plug>(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

Expand Down

0 comments on commit a7f4437

Please sign in to comment.