On Monday, February 17, 2014 10:13:41 PM UTC-5, Liang Li wrote:
> On Monday, February 17, 2014 10:01:41 PM UTC-5, Liang Li wrote:
> > Echoing a message longer than screenlines in input() will activate a pager, 
> > but quiting this pager, either via <esc> or q, will terminate the script 
> > without an error message. Ie, consider:
> > 
> > fun! Test()
> >     let input=input(join(map(range(200),'v:val."\n"')))
> >     echom 'This message is never displayed if you pressed q'
> > endfun
> > 
> > fun! Test2()
> >     call Test()
> >     echom 'This message is never displayed either'
> > endfun
> > 
> > However, if the pager is not activated, pressing <esc> would return an 
> > empty string. Shouldn't it return an empty string in both cases?
> 
> oops... this actually happens with all pagers, ie:
> 
> fun! Test()
>       echo join(map(range(200),'v:val."\n"'))
>       echom 'This message is never displayed if you pressed q'
> endfun
>  
> fun! Test2()
>       call Test()
>       echom 'This message is never displayed either'
> endfun

Just to be clear, I think this is a bug. Exiting the pager should not cause the 
script calling the pager to terminate without any message -- window sizes, 
output string lengths, etc. are all unpredictable, this property basically 
means you should never use the pager (:set nomore) in your script if you need 
to do any kind of cleanup.

-- 
-- 
You received this message from the "vim_dev" 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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui