-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Balloons not functional in terminal vim 8.1.1073 #2442
Comments
I would like to report the same problem with a slightly different configuration:
My relevant vimrc:
My ALEInfo:
|
Try putting |
Also, let me know what the output of |
I moved The output of |
I can't figure out myself how to enable balloons in any terminal I've tried. Maybe @gagbo has some advice. My advice is to use GVim. |
Which tools are you using that that you expect to see hover information from? Are you using a language server, and can you get diagnostics from it? Does the language sever you are using support hover information? |
Terminal.app: Steps to see brief balloon:
It seems like the balloon won't show if the mouse cursor is not visible. Since keyboard input hides the mouse cursor this is quickly kills the balloon. The issue with terminal vim seems to be that the balloon won't show up unless you're mouse-hovering and then the vim cursor moves. This shows a brief flash of the balloon, but only sometimes. The position of the vim cursor doesn't appear to matter, just that it moves while the mouse cursor is hovering and visible. I haven't gone in to any source code, just doing some interactive testing here. |
Sorry if I am confused about the
Having said that, I decided to try replacing So, I think it's safe to say that it's the language plugin that is providing this type definition information on hover? Although, if it is possible via a language plugin, it would sure be nice to have a consistent behavior across all languages via |
@johnelliott - the behavior you're experiencing somewhat resembles what I have experienced and reported earlier in this thread TL;DR - hover over with mouse and some other event (like going into command mode by typing |
@petermbenjamin Oh yeah, going to command more is way more sticky than what I was doing previously. |
The ability to show balloons when hitting : makes this seem like it might just be a vim bug/limitation rather than an ALE issue (see: vim/vim#2481 and vim/vim#2352 ). |
I haven't used Vim in a while :) For reference, it all started on this PR and there's a gif with how it worked with RLS in gvim (Linux) when it was merged. I had no issues with terminal either when I tested it (but I didn't do a gif with working state at the time because reasons)
seems like intended behaviour : https://github.com/vim/vim/blob/master/runtime/doc/options.txt#L1147 . Checking the code is the only way to be 100% sure.
👍 especially 2481. Also, I can confirm on MacOs with
I cannot get balloons to work in Terminal, iTerm2, or Alacritty with the sample file below (adapted from vim help) " vim --clean beval_test.vim | source %
function! MyBalloonExpr()
return 'Cursor is at line ' . v:beval_lnum .
\', column ' . v:beval_col .
\ ' of file ' . bufname(v:beval_bufnr) .
\ ' on word "' . v:beval_text . '"'
endfunction
set bexpr=MyBalloonExpr()
set ballooneval
set balloonevalterm
set ttymouse=sgr " I copied that from an earlier comment just to be sure, same behaviour without this line I don't have any issues making this work with the associated mvim. So at least until the above snippet works in terminal vim, this is a vim issue first. If this works and fails in ALE, this will become an ALE issue. |
One issue with mouse support in terminals is that it might not be Vim's fault either. Some terminals don't track where the mouse is. |
Fair enough, I should have said it's an "upstream (vim and/or terminal)" issue first, instead of just a "vim issue". The short script provides an easy first step for checking balloon problems at least. |
I had problem with balloons auto closing very quickly after showing on vim version 8.1.1073, so I built the latest version and the problem disappeared. I even made franken balloonexpr gathered from different approaches from the internet. I'm using zsh5.4.2 tmux2.9a vim8.1-1826 The custom balloon func previews - folds, ale lint warnings/errors, golang info. vimrc: set ttymouse=sgr
set balloondelay=250
set ballooneval
set balloonevalterm
" Returns either the contents of a fold, lint err/warn or godef.
function! BalloonExpr()
let foldStart = foldclosed(v:beval_lnum)
" check if we are in a fold
if foldStart >= 0
let foldEnd = foldclosedend(v:beval_lnum)
let numLines = foldEnd - foldStart + 1
let lines = []
" Up to 31 lines get shown okay; beyond that, only 30 lines are shown with
" ellipsis in between to indicate too much. The reason why 31 get shown ok
" is that 30 lines plus one of ellipsis is 31 anyway.
if ( numLines > 31 )
let lines = getline( foldStart, foldStart + 14 )
let lines += [ '-- Snipped ' . ( numLines - 30 ) . ' lines --' ]
let lines += getline( foldEnd - 14, foldEnd )
else
let lines = getline( foldStart, foldEnd )
endif
"return join( lines, has( "balloon_multiline" ) ? "\n" : " " )
call popup_beval(lines, #{mousemoved:'word'})
return ""
endif
" check if there is a lint error on the line
let l:loclist = get(g:ale_buffer_info, v:beval_bufnr, {'loclist': []}).loclist
let l:index = ale#util#BinarySearch(l:loclist, v:beval_bufnr, v:beval_lnum, v:beval_col)
" get the lint message if found
if l:index >= 0
return l:loclist[l:index].text
endif
" use golang as default
return go#tool#DescribeBalloon()
endfunction
set balloonexpr=BalloonExpr() |
I don't think there's a bug in ALE here. It's either troubles with different terminal types, Vim configuration, or bugs in Vim. |
This does not seem like an answer to the issue at hand; it seems like a dodge of dealing with the issue because you personally use gvim and think that is the way to go. This is still an issue. We can see that many projects with language servers have this working in vim, so I don't think it's a vim drawback. |
Hello! I am trying to get balloons working in my terminal for the first time. Everything works with gvim, but the balloons don't work in console vim. This is using gnome-terminal on arch linux.
The relevant portion of my vimrc is included below; I load the plugin with pathogen only after setting (what I think to be) the required options:
I can confirm that in general mouse support works fine for me (I've been using those settings for a long time without issue) in terminal vim, and also I can manually run e.g.
call balloon_show(bufname('%'))
which does display a balloon under the location of my cursor. So I guess it's an ALE specific issue (either a misconfiguration on my end or a bug).ALEInfo included below:
Thanks!
The text was updated successfully, but these errors were encountered: