Skip to content
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

add guru describe information in balloon #1975

Merged
merged 5 commits into from
Feb 23, 2019
Merged

Conversation

bhcleek
Copy link
Collaborator

@bhcleek bhcleek commented Sep 18, 2018

Teach vim-go how to display balloons with information from guru describe.

During development, I had to experiment a bit with the best way to hook this up. During those experiments I made a few other topical changes:

  • DRY out the :GoInfo display code so there's only one place that has to change if we modify it again instead of having to remember to do it for both modes.
  • Use the config functions in plugin/go.vim instead of referencing the config values explicitly.
  • Remove some extra spaces.

A few things to note for any testers:

  • the balloons work well with iTerm, but not in tmux. It's not clear if there's anyway to get them to work in tmux.
  • Neovim does not support balloons.
  • I explicitly added an early return when jobs are not available to avoid the performance problems that synchronous calls to populate the balloon would cause...

Fixes #1963

@tmc
Copy link
Contributor

tmc commented Feb 22, 2019

Would love to see this refreshed

@bhcleek bhcleek merged commit d6beab4 into fatih:master Feb 23, 2019
@bhcleek bhcleek deleted the balloon-info branch February 23, 2019 15:58
bhcleek added a commit that referenced this pull request Feb 23, 2019
@arush-sal
Copy link

So, I added the following additional lines in my .vimrc

let s:counter = 0
let s:timer = -1
set mouse=a
set ttymouse=sgr
set balloonexpr=go#tool#DescribeBalloon()
set balloondelay=250
set ballooneval
set balloonevalterm

& tested this with the following setup:

OS Terminal Shell tmux balloon shows
Mac 10.14 iTerm zsh(with oh-my-zsh) no yes
Mac 10.14 iTerm zsh(with oh-my-zsh) yes yes
Ubuntu gnone-teminal zsh(with oh-my-zsh) no only after a key press
Ubuntu gnone-teminal zsh(with oh-my-zsh) yes only after a key press
Ubuntu gnone-teminal bash no only after a key press
Ubuntu gnone-teminal bash yes only after a key press

On Mac the setup worked like a charm, w/o any issues. But on Ubuntu(with and without tmux) the respective balloon shows up only once if you press a key after you hover the move over the respective element. Even in case of the example mentioned in 1963 the balloon shows up with the value 0 until any key is press, once you press a key then only the correct value is shown instead of 0.

Any idea what could be causing such a behaviour?

@shaneHowearth
Copy link

let s:counter = 0
let s:timer = -1
set mouse=a
set ttymouse=sgr
set balloonexpr=go#tool#DescribeBalloon()
set balloondelay=250
set ballooneval
set balloonevalterm

Wow, thanks for the .vimrc settings, I am running Ubuntu, terminal, tmux, bash, and with your settings the balloons come up immediately.
I'm on commit 8465d62

$ vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 10 2018 21:31:58)
Included patches: 1-1453
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by pkg-vim-maintainers@lists.alioth.debian.org

$ tmux -V
tmux 2.6

@arush-sal
Copy link

@shaneHowearth Lucky you, my friend. I tested the same on a friend's system and everything did work properly and as expected. So, as it seems that the issue is with my system & my setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add vim balloon support for :GoInfo
4 participants