Closed DasOhmoff closed 3 years ago
@DasOhmoff would you be able to test out PR #741 and see if this resolves the issue for you?
Yes. I did.
It indeed seems to have fixed the issue with the wrapping. But weirdly enough it doesn't seem to be restoring some other settings. For example line numbers still don't get restored, they are still off. (I always turn them on by default through my vim config)
OK, that sounds like an issue with window-local/buffer-local/global options. I'll have to look into what information neovim makes available.
I'm just going to change the issue title to make it clear that this is a neovim-specific issue.
@DasOhmoff it turned out not to be a local/global option, but a floating window config option which we were using in a way that appeared to be consistent with the recommendations from the help, but reduces how much control we have over options like 'number':
nvim_open_win({buffer}, {enter}, {config}) *nvim_open_win()*
…
{config} Map defining the window configuration. Keys:
…
• `style`: Configure the appearance of the window.
Currently only takes one non-empty value:
• "minimal" Nvim will display the window with
many UI options disabled. This is useful
when displaying a temporary float where the
text should not be edited. Disables
'number', 'relativenumber', 'cursorline',
'cursorcolumn', 'foldcolumn', 'spell' and
'list' options. 'signcolumn' is changed to
`auto` and 'colorcolumn' is cleared. The
end-of-buffer region is hidden by setting
`eob` flag of 'fillchars' to a space char,
and clearing the |EndOfBuffer| region in
'winhighlight'.
I've pushed a change to the PR which removes it, but I don't know if this will cause other unexpected behaviour. Would you give it a spin?
Thank you for your efforts. Yes. I tried it out. It seems to be working, the options don't get changed.
The only issue now is that commands like OmniSharpDocumentation
and OmniSharpSignatureHelp
(which show the popup window) also show line numbers, etc. So if one enables in his config line number f.e, they also get shown in the popup window.
I suppose that's what that "style": "minimal"
option is all about, displaying popup content in a simplified way.
Perhaps the correct way forward is to keep "style": "minimal"
as we had before for displaying non-buffer content (documentation and signature help), and drop it for "buffer" popups such as previews?
I pushed a commit to the PR, tell me how that goes
I think it is working very well. I was not able to spot any issues :)
Hello, thank you for your help.
In my vim config I set the following line:
These options get set when the popup window gets opened. The problem is that these options don't get reset back again after the popup window gets closed. This causes issues when f.e previewing definitions, etc. Is there a way to reset these options after the popup window gets closed?
Steps to reproduce.
<plug>(omnisharp_preview_definition)
to open up a preview popup window. Now wrapping gets applied in the preview window.<plug>(omnisharp_go_to_definition)
to open up the file:set wrap?
to see that the wrapping of the text is still applied, even after the popup window got closedMy vim configuration automatically saves the layout of the window through the command
autocmd BufWinEnter ?* mkview!
as well, making it even more complicated, because now theses options persist throughout sessions and restarts.I looked through the source code, and noticed the following line, maybe that is a good starting point to somehow achieve this goal: https://github.com/OmniSharp/omnisharp-vim/blob/e847eccc7d1f39ea660a20743cd87c96156cbb6a/autoload/OmniSharp/popup.vim#L202 It seems that the options are getting set there.