Skip to content

Commit b9b6881

Browse files
committed
Add fall#internal#picker module for consistency
1 parent c067c77 commit b9b6881

3 files changed

Lines changed: 16 additions & 32 deletions

File tree

autoload/fall/command/Fall.vim

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@ function! fall#command#Fall#call(args) abort
22
if denops#plugin#wait('fall') isnot# 0
33
return
44
endif
5-
let l:laststatus_saved = &laststatus
65
try
7-
call s:hide()
8-
call fall#internal#mapping#store()
6+
call fall#internal#picker#setup()
97
call denops#request('fall', 'picker:command', [a:args])
108
finally
11-
call s:show()
12-
call fall#internal#tolerant#call({ -> fall#internal#mapping#restore() })
13-
call fall#internal#tolerant#call({ -> fall#internal#popup#closeall() })
9+
call fall#internal#picker#teardown()
1410
endtry
1511
endfunction
1612

@@ -20,13 +16,3 @@ function! fall#command#Fall#complete(arglead, cmdline, cursorpos) abort
2016
endif
2117
return denops#request('fall', 'picker:command:complete', [a:arglead, a:cmdline, a:cursorpos])
2218
endfunction
23-
24-
function! s:hide() abort
25-
call fall#internal#tolerant#call({ -> fall#internal#msgarea#hide() })
26-
call fall#internal#tolerant#call({ -> fall#internal#cursor#hide() })
27-
endfunction
28-
29-
function! s:show() abort
30-
call fall#internal#tolerant#call({ -> fall#internal#msgarea#show() })
31-
call fall#internal#tolerant#call({ -> fall#internal#cursor#show() })
32-
endfunction

autoload/fall/command/FallResume.vim

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@ function! fall#command#FallResume#call(filter) abort
22
if denops#plugin#wait('fall') isnot# 0
33
return
44
endif
5-
let l:laststatus_saved = &laststatus
65
try
7-
call s:hide()
8-
call fall#internal#mapping#store()
6+
call fall#internal#picker#setup()
97
call denops#request('fall', 'picker:resume:command', [a:filter])
108
finally
11-
call s:show()
12-
call fall#internal#tolerant#call({ -> fall#internal#mapping#restore() })
13-
call fall#internal#tolerant#call({ -> fall#internal#popup#closeall() })
9+
call fall#internal#picker#teardown()
1410
endtry
1511
endfunction
1612

@@ -20,13 +16,3 @@ function! fall#command#FallResume#complete(arglead, cmdline, cursorpos) abort
2016
endif
2117
return denops#request('fall', 'picker:resume:command:complete', [a:arglead, a:cmdline, a:cursorpos])
2218
endfunction
23-
24-
function! s:hide() abort
25-
call fall#internal#tolerant#call({ -> fall#internal#msgarea#hide() })
26-
call fall#internal#tolerant#call({ -> fall#internal#cursor#hide() })
27-
endfunction
28-
29-
function! s:show() abort
30-
call fall#internal#tolerant#call({ -> fall#internal#msgarea#show() })
31-
call fall#internal#tolerant#call({ -> fall#internal#cursor#show() })
32-
endfunction

autoload/fall/internal/picker.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function! fall#internal#picker#setup() abort
2+
call fall#internal#tolerant#call({ -> fall#internal#msgarea#hide() })
3+
call fall#internal#tolerant#call({ -> fall#internal#cursor#hide() })
4+
call fall#internal#mapping#store()
5+
endfunction
6+
7+
function! fall#internal#picker#teardown() abort
8+
call fall#internal#tolerant#call({ -> fall#internal#msgarea#show() })
9+
call fall#internal#tolerant#call({ -> fall#internal#cursor#show() })
10+
call fall#internal#tolerant#call({ -> fall#internal#mapping#restore() })
11+
call fall#internal#tolerant#call({ -> fall#internal#popup#closeall() })
12+
endfunction

0 commit comments

Comments
 (0)