Lcd wrote:

>     Some background first.
> 
>     If you're running a GUI Vim, 'ballooneval' is true and 'balloonexpr'
> is set to an expression, whenever the mouse rests for a short while
> pointing to a non-blank character the said expression is evaluated
> and the result is shown in a "balloon".  A number of v: variables are
> available for use in the expression, such as the coordinates the mouse
> is pointing to.
> 
>     The expression is supposed to return either a string, or a list of
> strings.  There's a bit of fun related to what happens if the underlying
> OS can't handle multiline balloons, but let's assume the OS can actually
> deal with them.
> 
>     Now the problem.
> 
>     According to the manual:
> 
> : When they are supported "\n" characters will start a new line.  If the
> : expression evaluates to a |List| this is equal to using each List item
> : as a string and putting "\n" in between them.
> 
>     The problem is a trailing "\n" is always added when the expression
> evaluates to a list, and this is pretty much never what you want.
> Namely, compare the effect of:
> 
>         set beval bexpr=['foo']
> 
> to the effect of:
> 
>         set beval bexpr='foo'
> 
>     This happens because general_beval_cb() in gui_beval.c calls
> eval_to_string() to evaluate 'balloonexpr', and that function adds the
> trailing "\n".  I don't see any non-intrusive fix to this.

Well, general_beval_cb() stores the resulting string in "result".  It
should be easy to remove a trailing newline from it.  Assuming this
newline is never useful.

-- 
press CTRL-ALT-DEL for more information

 /// Bram Moolenaar -- [email protected] -- 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    ///

-- 
-- 
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/d/optout.

Raspunde prin e-mail lui