input() doesn't work when called from normal command

48 views
Skip to first unread message

mattn

unread,
Sep 19, 2013, 11:00:35 PM9/19/13
to vim...@googlegroups.com
Hi.

---
function! s:confirm_and_input()
let a = confirm("Your Sex?", "Male\nFemale")
echo input("Your Name?", )
endfunction

nnoremap <buffer> <c-d> :call <SID>confirm_and_input()<cr>
exe "normal \<c-d>"
---

When :so this script, confirm() works well but input() doesn't.
input() return empty string always. This caused that ex_normal_busy flag is
not zero. I think this should be worked even-though called from normal command. Below is a patch.
Please check.

https://gist.github.com/6632781

- Yasuhiro Matsumoto

Bram Moolenaar

unread,
Sep 20, 2013, 4:55:45 PM9/20/13
to mattn, vim...@googlegroups.com
Thanks. I wonder if there are side effects. There was a reason it was
done the way it is, but I don't immediately recall what it was.

--
"After a few years of marriage a man can look right at a woman
without seeing her and a woman can see right through a man
without looking at him."
- Helen Rowland

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

mattn

unread,
Sep 21, 2013, 1:24:09 AM9/21/13
to vim...@googlegroups.com, mattn
I guess that it is the way to do graceful for displaying without "-- hit return --" when it called from normal command.
Reply all
Reply to author
Forward
0 new messages