Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

Replace char-by-char sends with a single call #15

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions autoload/zepl.vim
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,7 @@ function! zepl#send(text, ...) abort
if has('nvim')
call chansend(getbufvar(s:repl_bufnr, '&channel'), text)
else
let text = split(text, '\m\C[\r\n]\+\zs', 1)

for line in text
" 'firstchar' is a fix for rlwrap incorrectly detecting prompts.
" See: <https://github.com/axvr/zepl.vim/issues/9>
let firstchar = 1
for char in line
call term_sendkeys(s:repl_bufnr, char)
if firstchar
call term_wait(s:repl_bufnr, 1)
let firstchar = 0
endif
endfor
call term_wait(s:repl_bufnr)
endfor
call term_sendkeys(s:repl_bufnr, text)
endif
endfunction

Expand Down