vimspector icon indicating copy to clipboard operation
vimspector copied to clipboard

[Feature Request]: winbar support for neovim

Open rewhile opened this issue 3 years ago • 8 comments

Is your feature request related to a problem? Please describe. Support for a bar at the top of each window was added in https://github.com/neovim/neovim/pull/18562 along with click support too https://github.com/neovim/neovim/pull/18650

Describe the solution you'd like I will be gone for a while so opened this early before the next neovim release.

rewhile avatar May 24 '22 12:05 rewhile

Sadly, it looks like neovim have decided to implement a completely incompatible version of the vim feature, so unless someone wants to contribute changes and tests for this, I'm unlikely to spend time on it.

I can't understand why the neovim devs decided to do that, but shrug.

puremourning avatar May 24 '22 12:05 puremourning

For tabline, neovim extend it from just support limited function like %1T1 for mouse support to %1@CustomFunctionHere@1

The syntax is 1 to 1 from tabline to winbar

In vim

function! s:CustomWinBar()
    call win_gotoid( g:vimspector_session_windows.code)
    aunmenu WinBar
    nnoremenu WinBar.▷\ ᶠ⁵ :call vimspector#Continue()<CR>
    nnoremenu WinBar.↷\ ᶠ¹⁰ :call vimspector#StepOver()<CR>
    nnoremenu WinBar.↓\ ᶠ¹¹ :call vimspector#StepInto()<CR>
    nnoremenu WinBar.↑\ ˢᶠ¹¹ :call vimspector#StepOut()<CR>
    nnoremenu WinBar.❘❘\ ᶠ⁶ :call vimspector#Pause()<CR>
    nnoremenu WinBar.□\ ˢᶠ⁵ :call vimspector#Stop()<CR>
    nnoremenu WinBar.⟲\ ᶜˢᶠ⁵ :call vimspector#Restart()<CR>
    nnoremenu WinBar.✕\ ᶠ⁸ :call vimspector#Reset()<CR>
endfunction

In neovim :set winbar=%1@vimspector#Continue()@Continue%2@vimspector#StepOver()@StepOver

I think the completely incompatible version of vim is better but I will not be opinionated here.

rewhile avatar May 24 '22 13:05 rewhile

It's not about what's better, it's about what level of hacks I am willing to maintain forever. I don't have tests for neovim, and I already have to maintain complete rewrites of all job control and popup functionality. Now I have to maintain rewrite of the winbar functionality too? ugh... I don't fancy it. Particularly as I use nunmenu, etc. in the output view which will be a pain to do equivalently using this winbar= setting, which requires construction of some complex string rather than a series of commands.

Anyway like I said, quality community contribution welcome. This particular change has no benefit to me, so I'm not likely to spend my limited free time working on it, sorry.

puremourning avatar May 24 '22 13:05 puremourning

I think it will be better than "some complex string" after lua version of this is out.

Have a great day!

rewhile avatar May 24 '22 13:05 rewhile

heh, there's 0 chance I'll maintain any Lua, though...

puremourning avatar May 24 '22 13:05 puremourning

heh

image

rewhile avatar May 24 '22 13:05 rewhile

let's keep this open in case someone wants to work on it.

puremourning avatar May 24 '22 14:05 puremourning

Sadly, it looks like neovim have decided to implement a completely incompatible version of the vim feature, so unless someone wants to contribute changes and tests for this, I'm unlikely to spend time on it.

I can't understand why the neovim devs decided to do that, but shrug.

@puremourning Partially true :) It is an explicitly stated goal for nvim 0.8 to also support vim8 style WinBar menus. 0.8 is still in development software, some patience might be required before its features are feature complete.

bfredl avatar May 24 '22 16:05 bfredl

@puremourning @bfredl Nvim v0.8.0 just released a few weeks ago with winbar support. Perhaps this can become a reality now?

unrealapex avatar Oct 14 '22 04:10 unrealapex

@UnrealApex Did you read the conversation?

The author won't implement it unless neovim support vim8 winbar menus. However, you are welcome to make a pull request.

rewhile avatar Oct 14 '22 04:10 rewhile

If, as @bfredl says the neovim api is going to be compatible with Vim's, then it should just be a one line change.

puremourning avatar Oct 14 '22 09:10 puremourning

Any update on this?

unrealapex avatar Dec 26 '22 04:12 unrealapex

The neovim api is nothing like the vim one. So no.

puremourning avatar Dec 26 '22 09:12 puremourning

I see. Perhaps some day.

unrealapex avatar Dec 26 '22 09:12 unrealapex

Unlikely, without community contribution.

puremourning avatar Dec 26 '22 09:12 puremourning

@bfredl

It is an explicitly stated goal for nvim 0.8 to also support vim8 style WinBar menus.

I just checked and this doesn't seem to be the case in neovim 0.9. Confirm?

puremourning avatar Apr 17 '23 14:04 puremourning

correct.

bfredl avatar Apr 17 '23 15:04 bfredl

Well, I tried to implement this, despite the obtuse "API". Anyway looks like it's blocked by https://github.com/neovim/neovim/issues/23165

puremourning avatar Apr 17 '23 16:04 puremourning