[vim/vim] Call to balloon_show() doesn't show the balloon in the terminal (#2352)

45 views
Skip to first unread message

Boris Staletic

unread,
Nov 20, 2017, 3:11:25 AM11/20/17
to vim/vim, Subscribed

Running currently the latest Vim (8.0.1322).

I have +balloon_eval_term and I have set balloonevalterm.
To my understanding, :call balloon_show(bufname('%')) should show a balloon in my terminal displaying the current buffer name. Yet, nothing is shown.

If I do :echo balloon_show(bufname('%'))' it echos0` to the command line, which I assume is expected.

For completeness:

:version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Nov 20 2017 08:32:56)
Included patches: 1-1322
Modified by Gentoo-9999
Compiled by portage@gentoo
Huge version without GUI.  Features included (+) or not (-):
+acl               +cmdline_hist      +eval              +job               +mouse             +num64             +scrollbind        +termresponse      +windows
+arabic            +cmdline_info      +ex_extra          +jumplist          -mouseshape        +packages          +signs             +textobjects       +writebackup
+autocmd           +comments          +extra_search      +keymap            +mouse_dec         +path_extra        +smartindent       +timers            +X11
-autoservername    +conceal           +farsi             +lambda            -mouse_gpm         -perl              +startuptime       +title             +xfontset
-balloon_eval      +cryptv            +file_in_path      +langmap           -mouse_jsbterm     +persistent_undo   +statusline        -toolbar           -xim
+balloon_eval_term -cscope            +find_in_path      +libcall           +mouse_netterm     +postscript        -sun_workshop      +user_commands     -xpm
-browse            +cursorbind        +float             +linebreak         +mouse_sgr         +printer           +syntax            +vertsplit         +xsmp_interact
++builtin_terms    +cursorshape       +folding           +lispindent        -mouse_sysmouse    +profile           +tag_binary        +virtualedit       +xterm_clipboard
+byte_offset       +dialog_con        -footer            +listcmds          +mouse_urxvt       -python            +tag_old_static    +visual            -xterm_save
+channel           +diff              +fork()            +localmap          +mouse_xterm       +python3           -tag_any_white     +visualextra
+cindent           +digraphs          +gettext           -lua               +multi_byte        +quickfix          -tcl               +viminfo
+clientserver      -dnd               -hangul_input      +menu              +multi_lang        +reltime           +termguicolors     +vreplace
+clipboard         -ebcdic            +iconv             +mksession         -mzscheme          +rightleft         +terminal          +wildignore
+cmdline_compl     +emacs_tags        +insert_expand     +modify_fname      +netbeans_intg     -ruby              +terminfo          +wildmenu
   system vimrc file: "/etc/vim/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: x86_64-pc-linux-gnu-gcc -c -I. -Iproto -DHAVE_CONFIG_H     -march=native -O2 -pipe -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: x86_64-pc-linux-gnu-gcc   -Wl,-O1 -L/usr/local/lib -Wl,--as-needed -o vim    -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -lncurses -lnsl   -lacl -lattr -ldl
    -L/usr/lib64/python3.5/config-3.5m -lpython3.5m -lpthread -ldl -lutil -lm
:echo &balloonevalterm
1

Terminal is xterm.


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

Bram Moolenaar

unread,
Nov 20, 2017, 12:39:33 PM11/20/17
to vim/vim, Subscribed

Boris Staletic wrote:

> Running currently the latest Vim (8.0.1322).
>
> I have `+balloon_eval_term` and I have `set balloonevalterm`.

> To my understanding, `:call balloon_show(bufname('%'))` should show a balloon in my terminal displaying the current buffer name. Yet, nothing is shown.
>
> If I do `:echo balloon_show(bufname('%'))' it echos `0` to the command line, which I assume is expected.

As it currently works balloon_show() only works after evaluating
'balloonexpr'. This was added for asynchronously showing a balloon. It
doesn't work to show a balloon at some position. We could add that, but
it also requires defining some mechanism to unshow it later. Currently
it's a mouse move event, but mouse movement may not be tracked. Typing
any key might also work. And it's going to be tricky to make this work
in the GUI (unless we add yet another feature to use the terminal
implementation also in the GUI). Anyway, work in progress.

--
hundred-and-one symptoms of being an internet addict:
16. You step out of your room and realize that your parents have moved and
you don't have a clue when it happened.

/// 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 ///

Boris Staletic

unread,
Nov 20, 2017, 2:29:37 PM11/20/17
to vim/vim, Subscribed

As it currently works balloon_show() only works after evaluating
'balloonexpr'.

Then it's even more confusing that I don't get any balloons from Termdebug.

The way I was hoping to use this was to acompany the pumenu. Get actual completion candidates written to the pumenu and have parameter hinting in a balloon.
For that to work, balloons need to be able to be shown at cursor position in both, GUI and terminal.

Björn Linse

unread,
Nov 20, 2017, 2:52:37 PM11/20/17
to vim/vim, Subscribed

to me balloon_show() seems to work even if balloonexpr is unset. But it would be nice to allow track cursor position instead of mouse position, seems weird to restrict a feature like this to only mouse-based workflow. For instance vim-jedi uses tricks (concealing? even changing the buffer?) to show function signature "popup", if balloon at cursor was possible it could use it instead.

Davit Samvelyan

unread,
Nov 20, 2017, 3:06:07 PM11/20/17
to vim/vim, Subscribed

It would be even nicer to be able to specify balloon position. That way, for function parameter hinting, balloon can be shown above the function opening bracket. Otherwise it will be dragged along with the cursor while user is typing function arguments.

Björn Linse

unread,
Nov 20, 2017, 3:10:23 PM11/20/17
to vim/vim, Subscribed

Sure. I just mean in a cursor-based workflow, I would expect the balloon by default to show up somewhere near the cursor, rather than near a mouse movement that was done a long time ago.

Sam McCall

unread,
Feb 2, 2019, 6:12:35 AM2/2/19
to vim/vim, Subscribed

@bstaletic possible workaround for the original issue:

set balloonexpr=Dummy
function Dummy()
  " enable balloon_show()
  timer_start(0, {t->0})
  return ""
endfunction

Now balloon_show works for me (shows up at the last position balloonshow was triggered at).

The timer_start seems to be needed to trick vim into thinking the balloon is computed asynchronously. It's probably needed in YCM's case where the async nature is hidden from vim in ycmd.

Simon Sobisch

unread,
Feb 8, 2023, 3:42:39 AM2/8/23
to vim/vim, Subscribed

Was that solved by 2f10658?


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/2352/1422231835@github.com>

Reply all
Reply to author
Forward
0 new messages