git-messenger.vim
git-messenger.vim copied to clipboard
Use Vim8.1 popup feature
https://github.com/vim/vim/blob/master/runtime/doc/popup.txt
It seems about to be being implemented. If it works and sufficient for this plugin, using it would be better for Vim users.
As far as I understand a popup window cannot be focused so it wouldn't be possible to use the mappings etc.
Yeah, the point is a blocker. Currently I don't have good idea to workaround that.
I think if the user wants to use popups to see the blame info, it's useful even if they can't do anything with it. I suppose you can make the popup as big as the blame info, up to the size of the window, to minimise scrolling.
Current implementation determines size of float window following contents. However, sometimes commit body is too big. And if user wants to see diff of the commit, it would be not fit to window (diff is usually bigger).
Another point is local key maps in the float window. This plugin provides some mappings such as o
(show older commit). I also don't have good idea to provide the mappings without focusing (entering) a popup. Neovim's float window allows to move cursor into popup, so we can define window-local mappings. But that seems not available in Vim.
https://github.com/vim/vim/issues/4577 https://github.com/mhinz/vim-signify/pull/302
:help previewpopup
bump
I think operation likely that. bfrg/vim-qf-preview: Vim plugin to preview current quickfix item in a popup window (Vim-only)
(skip into preview; direct operation.)
Also the window currently opened immediately closes... I don't know why
@sheerun That's not related to this issue. See https://github.com/rhysd/git-messenger.vim/issues/54#issuecomment-667542845
nmap <silent><Leader>g :call setbufvar(winbufnr(popup_atcursor(split(system("git log -n 1 -L " . line(".") . ",+1:" . expand("%:p")), "\n"), { "padding": [1,1,1,1], "pos": "botleft", "wrap": 0 })), "&filetype", "git")<CR>
co -> https://www.reddit.com/user/sheerun/
Are Vim 8.1 and 8.2's popup windows the same?
Just asking because with Vim 8.2 along with FZF you can set let g:fzf_layout = { 'window': { 'width': 0.5, 'height': 0.6 } }
which gives you a floating window style popup that you can focus, interact with and move the cursor in. Even mouse events work.
There's lots of discussion around it and Vim script snippets at https://github.com/junegunn/fzf.vim/issues/821. That's in the context of FZF of course, but maybe that method could be applied here too?
All right, I'll make time to try to implement this feature this week.
Discussion here: https://github.com/vim/vim/issues/5639#issuecomment-593419210