[vim/vim] Multiline balloons in terminal are not multiline, but display newlines as ^@ (#5193)

14 views
Skip to first unread message

Buzzzz

unread,
Nov 8, 2019, 5:52:57 AM11/8/19
to vim/vim, Subscribed

Multiline balloon support is enabled according to :echo has("balloon_multiline") saying 1.

To Reproduce

function! MyBalloonExpr()
  let macros = {
\ 'true':"true\n1",
\ 'false':"false\n0",
\ }
  return get(macros, v:beval_text, '')
endfunction
set balloonexpr=MyBalloonExpr()
set ballooneval
set balloonevalterm

Expected behavior
Balloon for true displayed as

true
1

but displayed as true^@1.

  • Vim version e.g. 8.1.2269
  • OS: CentOS 7
  • Terminal: xterm-256color

(Works fine in the GUI version, only terminal version seems to be affected).


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

K.Takata

unread,
Nov 8, 2019, 6:07:30 AM11/8/19
to vim/vim, Subscribed

has("balloon_multiline") just returns whether the feature is enabled at compile time, however, balloon_multiline works only on GUI. Currently, it is not supported on terminal.

Buzzzz

unread,
Nov 8, 2019, 7:02:50 AM11/8/19
to vim/vim, Subscribed

@k-takata Are you sure? Because balloons work quite fine in the terminal. Only newlines have a problem.

Tony Mechelynck

unread,
Nov 8, 2019, 9:02:24 AM11/8/19
to vim/vim, Subscribed

@k-takata Are you sure? Because balloons work quite fine in the terminal. Only newlines have a problem.

From eval.txt line 10537 (under *feature-list*):

balloon_multiline	GUI supports multiline balloons.

Nothing is said about multiline balloons elsewhere. Balloons in the terminal is +balloon_eval_term which is not in that list (while ±balloon_multiline does not appear in the output of :version).

Best regards,
Tony.

Christian Brabandt

unread,
Nov 8, 2019, 10:04:08 AM11/8/19
to vim/vim, Subscribed

Closed #5193.

Buzzzz

unread,
Nov 8, 2019, 10:05:09 AM11/8/19
to vim/vim, Subscribed

@tonymec So I'm dealing with a Schröding-Feature here. It's there, but isn't at the same time :-)
I can even use true multiline ballons in the terminal when I add

'foo':"foo\nbar(line1, line2, line3, line4)",

which gets balloon-displayed as

foo^@bar(line1,

line2,

line3,

line4)

Observe how "comma space" is auto-converted to a newline. Just the escaped newline isn't. Can we please get this buglet fixed and call terminal multiline balloons "working like a charm"?

Christian Brabandt

unread,
Nov 8, 2019, 10:09:54 AM11/8/19
to vim/vim, Subscribed

So this is actually a feature request: "Please convert '\n' in balloon values to a true linefeed".

Christian Brabandt

unread,
Nov 8, 2019, 10:09:55 AM11/8/19
to vim/vim, Subscribed

Reopened #5193.

Buzzzz

unread,
Nov 8, 2019, 10:38:14 AM11/8/19
to vim/vim, Subscribed

@chrisbra ...like you already do for GUI balloons.

So this is actually a feature request: "Please convert '\n' in balloon values to a true linefeed".

...like gvim already does. My humble desire is matching behavior of ballon text for GUI and terminal, so I don't have to create different balloon configurations files for each because one of them gets quirky with newlines. Once that works, you may want to update the line in eval.txt that still says

balloon_multiline	GUI supports multiline balloons.

to accurately reflect the state of affairs. Thanks guys, you rock. Check for Bram is in the mail.

Ben Jackson

unread,
Nov 9, 2019, 8:08:32 AM11/9/19
to vim_dev
Maybe better off to use popup_beval these days.

Bram Moolenaar

unread,
Nov 9, 2019, 10:51:21 AM11/9/19
to vim/vim, Subscribed

Showing ^@ or <00> in the balloon is not useful. And that this works differently in a terminal vs GUI is also not good. It's easy enough to change.

Bram Moolenaar

unread,
Nov 9, 2019, 10:59:48 AM11/9/19
to vim/vim, Subscribed

Closed #5193 via d1c1c82.

Reply all
Reply to author
Forward
0 new messages