mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 17:40:06 +08:00
fix(prompt): check type instead of compare with string
E693: Can only compare Funcref with Funcref
This commit is contained in:
parent
6c27cd991c
commit
00cab12850
@ -66,10 +66,10 @@ endf
|
|||||||
func! s:self._handle_input(...) abort
|
func! s:self._handle_input(...) abort
|
||||||
let begin = get(a:000, 0, '')
|
let begin = get(a:000, 0, '')
|
||||||
if !empty(begin)
|
if !empty(begin)
|
||||||
if self._oninputpro !=# ''
|
if type(self._oninputpro) ==# 2
|
||||||
call call(self._oninputpro, [])
|
call call(self._oninputpro, [])
|
||||||
endif
|
endif
|
||||||
if self._handle_fly !=# ''
|
if type(self._handle_fly) ==# 2
|
||||||
call call(self._handle_fly, [self._prompt.begin . self._prompt.cursor . self._prompt.end])
|
call call(self._handle_fly, [self._prompt.begin . self._prompt.cursor . self._prompt.end])
|
||||||
endif
|
endif
|
||||||
call self._build_prompt()
|
call self._build_prompt()
|
||||||
@ -147,10 +147,10 @@ func! s:self._handle_input(...) abort
|
|||||||
let self._prompt.begin .= char
|
let self._prompt.begin .= char
|
||||||
call self._build_prompt()
|
call self._build_prompt()
|
||||||
endif
|
endif
|
||||||
if self._oninputpro !=# ''
|
if type(self._oninputpro) ==# 2
|
||||||
call call(self._oninputpro, [])
|
call call(self._oninputpro, [])
|
||||||
endif
|
endif
|
||||||
if self._handle_fly !=# ''
|
if type(self._handle_fly) ==# 2
|
||||||
call call(self._handle_fly, [self._prompt.begin . self._prompt.cursor . self._prompt.end])
|
call call(self._handle_fly, [self._prompt.begin . self._prompt.cursor . self._prompt.end])
|
||||||
endif
|
endif
|
||||||
endwhile
|
endwhile
|
||||||
@ -179,7 +179,7 @@ function! s:self._clear_prompt() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:self.close() abort
|
function! s:self.close() abort
|
||||||
if self._onclose !=# ''
|
if type(self._onclose) ==# 2
|
||||||
call call(self._onclose, [])
|
call call(self._onclose, [])
|
||||||
endif
|
endif
|
||||||
call self._clear_prompt()
|
call self._clear_prompt()
|
||||||
|
Loading…
Reference in New Issue
Block a user