Skip to content

Commit 184566f

Browse files
committed
💪 Rename internal events for list and preview components
1 parent de798ef commit 184566f

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

denops/fall/event.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export type Event =
2424
| { type: "select-item"; cursor?: number | "$"; method?: SelectMethod }
2525
| { type: "select-all-items"; method?: SelectMethod }
2626
| { type: "action-invoke"; name: string }
27-
| { type: "list-execute"; command: string }
28-
| { type: "preview-execute"; command: string }
27+
| { type: "list-component-execute"; command: string }
28+
| { type: "preview-component-execute"; command: string }
2929
| { type: "collect-processor-started" }
3030
| { type: "collect-processor-updated" }
3131
| { type: "collect-processor-succeeded" }

denops/fall/main/event.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ const isEventComplement = is.UnionOf([
5454
}),
5555
// List
5656
is.ObjectOf({
57-
type: is.LiteralOf("list-execute"),
57+
type: is.LiteralOf("list-component-execute"),
5858
command: is.String,
5959
}),
6060
// Preview
6161
is.ObjectOf({
62-
type: is.LiteralOf("preview-execute"),
62+
type: is.LiteralOf("preview-component-execute"),
6363
command: is.String,
6464
}),
6565
]) satisfies Predicate<Event>;

denops/fall/picker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,10 @@ export class Picker<T> implements AsyncDisposable {
322322
case "action-invoke":
323323
accept(event.name);
324324
break;
325-
case "list-execute":
325+
case "list-component-execute":
326326
this.#listComponent.execute(event.command);
327327
break;
328-
case "preview-execute":
328+
case "preview-component-execute":
329329
if (!this.#previewComponent) break;
330330
this.#previewComponent.execute(event.command);
331331
break;

plugin/fall/mapping.vim

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ cnoremap <silent> <Plug>(fall-prev) <Cmd>call fall#internal#dispatch(#{type: 'mo
1010
cnoremap <silent> <Plug>(fall-next) <Cmd>call fall#internal#dispatch(#{type: 'move-cursor', amount: 1})<CR>
1111
cnoremap <silent> <Plug>(fall-prev:scroll) <Cmd>call fall#internal#dispatch(#{type: 'move-cursor', amount: -1, scroll: v:true})<CR>
1212
cnoremap <silent> <Plug>(fall-next:scroll) <Cmd>call fall#internal#dispatch(#{type: 'move-cursor', amount: 1, scroll: v:true})<CR>
13-
cnoremap <silent> <Plug>(fall-left) <Cmd>call fall#internal#dispatch(#{type: 'list-execute', command: 'silent! normal! zh'})<CR>
14-
cnoremap <silent> <Plug>(fall-right) <Cmd>call fall#internal#dispatch(#{type: 'list-execute', command: 'silent! normal! zl'})<CR>
15-
cnoremap <silent> <Plug>(fall-left:scroll) <Cmd>call fall#internal#dispatch(#{type: 'list-execute', command: 'silent! normal! zH'})<CR>
16-
cnoremap <silent> <Plug>(fall-right:scroll) <Cmd>call fall#internal#dispatch(#{type: 'list-execute', command: 'silent! normal! zL'})<CR>
13+
cnoremap <silent> <Plug>(fall-left) <Cmd>call fall#internal#dispatch(#{type: 'list-component-execute', command: 'silent! normal! zh'})<CR>
14+
cnoremap <silent> <Plug>(fall-right) <Cmd>call fall#internal#dispatch(#{type: 'list-component-execute', command: 'silent! normal! zl'})<CR>
15+
cnoremap <silent> <Plug>(fall-left:scroll) <Cmd>call fall#internal#dispatch(#{type: 'list-component-execute', command: 'silent! normal! zH'})<CR>
16+
cnoremap <silent> <Plug>(fall-right:scroll) <Cmd>call fall#internal#dispatch(#{type: 'list-component-execute', command: 'silent! normal! zL'})<CR>
1717
1818
cnoremap <silent> <Plug>(fall-select) <Cmd>call fall#internal#dispatch(#{type: 'select-item'})<CR>
1919
cnoremap <silent> <Plug>(fall-select-all) <Cmd>call fall#internal#dispatch(#{type: 'select-all-items'})<CR>
2020
2121
" Preview
22-
cnoremap <silent> <Plug>(fall-preview-first) <Cmd>call fall#internal#dispatch(#{type: 'preview-execute', command: 'silent! normal! gg'})<CR>
23-
cnoremap <silent> <Plug>(fall-preview-last) <Cmd>call fall#internal#dispatch(#{type: 'preview-execute', command: 'silent! normal! G'})<CR>
24-
cnoremap <silent> <Plug>(fall-preview-prev) <Cmd>call fall#internal#dispatch(#{type: 'preview-execute', command: 'silent! normal! k'})<CR>
25-
cnoremap <silent> <Plug>(fall-preview-next) <Cmd>call fall#internal#dispatch(#{type: 'preview-execute', command: 'silent! normal! j'})<CR>
26-
cnoremap <silent> <Plug>(fall-preview-prev:scroll) <Cmd>call fall#internal#dispatch(#{type: 'preview-execute', command: 'silent! normal! <C-u>'})<CR>
27-
cnoremap <silent> <Plug>(fall-preview-next:scroll) <Cmd>call fall#internal#dispatch(#{type: 'preview-execute', command: 'silent! normal! <C-d>'})<CR>
28-
cnoremap <silent> <Plug>(fall-preview-left) <Cmd>call fall#internal#dispatch(#{type: 'preview-execute', command: 'silent! normal! zh'})<CR>
29-
cnoremap <silent> <Plug>(fall-preview-right) <Cmd>call fall#internal#dispatch(#{type: 'preview-execute', command: 'silent! normal! zl'})<CR>
30-
cnoremap <silent> <Plug>(fall-preview-left:scroll) <Cmd>call fall#internal#dispatch(#{type: 'preview-execute', command: 'silent! normal! zH'})<CR>
31-
cnoremap <silent> <Plug>(fall-preview-right:scroll) <Cmd>call fall#internal#dispatch(#{type: 'preview-execute', command: 'silent! normal! zL'})<CR>
22+
cnoremap <silent> <Plug>(fall-preview-first) <Cmd>call fall#internal#dispatch(#{type: 'preview-component-execute', command: 'silent! normal! gg'})<CR>
23+
cnoremap <silent> <Plug>(fall-preview-last) <Cmd>call fall#internal#dispatch(#{type: 'preview-component-execute', command: 'silent! normal! G'})<CR>
24+
cnoremap <silent> <Plug>(fall-preview-prev) <Cmd>call fall#internal#dispatch(#{type: 'preview-component-execute', command: 'silent! normal! k'})<CR>
25+
cnoremap <silent> <Plug>(fall-preview-next) <Cmd>call fall#internal#dispatch(#{type: 'preview-component-execute', command: 'silent! normal! j'})<CR>
26+
cnoremap <silent> <Plug>(fall-preview-prev:scroll) <Cmd>call fall#internal#dispatch(#{type: 'preview-component-execute', command: 'silent! normal! <C-u>'})<CR>
27+
cnoremap <silent> <Plug>(fall-preview-next:scroll) <Cmd>call fall#internal#dispatch(#{type: 'preview-component-execute', command: 'silent! normal! <C-d>'})<CR>
28+
cnoremap <silent> <Plug>(fall-preview-left) <Cmd>call fall#internal#dispatch(#{type: 'preview-component-execute', command: 'silent! normal! zh'})<CR>
29+
cnoremap <silent> <Plug>(fall-preview-right) <Cmd>call fall#internal#dispatch(#{type: 'preview-component-execute', command: 'silent! normal! zl'})<CR>
30+
cnoremap <silent> <Plug>(fall-preview-left:scroll) <Cmd>call fall#internal#dispatch(#{type: 'preview-component-execute', command: 'silent! normal! zH'})<CR>
31+
cnoremap <silent> <Plug>(fall-preview-right:scroll) <Cmd>call fall#internal#dispatch(#{type: 'preview-component-execute', command: 'silent! normal! zL'})<CR>
3232
3333
" Action
3434
cnoremap <silent> <Plug>(fall-action-select) <Cmd>call fall#action('@select')<CR>

0 commit comments

Comments
 (0)