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

Float window is not respectively sized its the content #38

Open
megalithic opened this issue Sep 9, 2019 · 5 comments
Open

Float window is not respectively sized its the content #38

megalithic opened this issue Sep 9, 2019 · 5 comments
Labels

Comments

@megalithic
Copy link

megalithic commented Sep 9, 2019

Love this plugin, however, at some point, the floating window just got huge/oversized and won't size to the content itself. I've tried setting the g:git_messenger_max_popup_height and g:git_messenger_max_popup_width plugin preferences, but they don't seem to make a difference. CoC and other popup/floating window plugins seem to be fine. Any thoughts of what I might look at/adjust to try and fix?

git-messenger-float-window-oversized

@rhysd
Copy link
Owner

rhysd commented Sep 10, 2019

Float window size should be shrunk to fit to its contents as screenshot in README file. Window size is calculated here:

https://github.com/rhysd/git-messenger.vim/blob/master/autoload/gitmessenger/popup.vim#L59

However, as you showed in screenshot, the calculation seems not correct in some case. Would you tell me more information to reproduce this. Then I would be able to analyze what is happening.

@rhysd rhysd added the bug label Sep 10, 2019
@megalithic
Copy link
Author

@rhysd thank you, i went and added some echo's for the height and width reported by that function you referenced above. i'm getting a computed width of 50 and a height of 8. That DEFINITELY doesn't look right. I don't know how to tell you to recreate. Other than pulling down my config found here: https://github.com/megalithic/dotfiles/blob/master/nvim/init.vim

@rhysd
Copy link
Owner

rhysd commented Sep 11, 2019

Thank you for confirming that. I'm trying your repository. However, on my local environment, the window size is correct:

スクリーンショット 2019-09-11 9 54 51

There would be some hidden condition. Would you check the opts variable here?

let opts = self.floating_win_opts(width, height)

It is an option dictionary passed to nvim_open_win(). I want to confirm options are correct or not. If the value is correct, perhaps it may be a bug of Neovim or some effects from other plugins. Rebuilding the latest nightly Neovim may solve this issue in the case.

@megalithic
Copy link
Author

@rhysd thanks again for helping with this.. please find the attached screenshot (see the echo'd sizings from the line number you mentioned for the opts dict)

Screenshot 2019-09-12 09 09 00

@rhysd
Copy link
Owner

rhysd commented Sep 14, 2019

Thank you for trying that.

Let me confirm one thing. The output in your screenshot is

OPTS: width54, height: 11, row: 1, col: 0

Does it mean that the opts dict was { width: 54, height: 11, row: 1, col: 0}? If you're ok, adding following line and dumping entire dictionary would be more helpful:

echom string(opts)

Anyway, it seems that a dictionary passed to nvim_open_win() has correct size information. I'm still not understanding why your float window does not follow the size. Possible reasons would be

  1. Some autocmd hook changes size of window (some other plugin may hook WinEnter or BufEnter or some events)
  2. Neovim's bug

Would you also tell me your OS and Neovim's version (especially the git revision of your Neovim build)? Then I would be able to align environment with you. If possible, temporarily removing other plugins and load only git-messenger.vim in your environment is helpful to ensure that other plugin does not affect.

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

No branches or pull requests

2 participants