Friday, August 26, 2011

getchar() blocks the output

hi,

i've the following function.

1 fun! Dosome()
2 vertical botright new
3 setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile
4 setlocal nowrap
5 setlocal nonu
6
7 for m in g:list
8 let txt = printf("%s %-50s %-4d %-50s", m[0], m[1]. "()",
m[2], m[3])
9 put =txt
10 endfor
11
12 let char = getchar()
13 setlocal nomodifiable
14 silent! "'".char
15 endfun

basically i want to display a list of choices for the user and based
on the users input i will take some action. so the lines 7-8 will
actually list the users with some choices in a new window. but the
window is not getting opened because of getchar(), according to
the code that's what suppose to happen. why getchar() is blocking
output, is there any way around this.

thanks

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: