[vim] Escape ! when using :! to execute command

- call fzf#run({'source': "echo '!'"})
- call fzf#run({'source': "echo '!'", 'down': '40%'})

Close https://github.com/junegunn/fzf.vim/issues/315
This commit is contained in:
Junegunn Choi 2017-02-19 20:47:44 +09:00
parent e87a85a179
commit 76d3f6d248
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -451,7 +451,7 @@ function! s:execute(dict, command, use_height, temps) abort
let stdin = has_key(a:dict, 'source') ? '' : '< /dev/tty' let stdin = has_key(a:dict, 'source') ? '' : '< /dev/tty'
call system(printf('tput cup %d > /dev/tty; tput cnorm > /dev/tty; %s %s 2> /dev/tty', &lines, command, stdin)) call system(printf('tput cup %d > /dev/tty; tput cnorm > /dev/tty; %s %s 2> /dev/tty', &lines, command, stdin))
else else
execute 'silent !'.command execute 'silent !'.escape(command, '!')
endif endif
let exit_status = v:shell_error let exit_status = v:shell_error
redraw! redraw!