-
Notifications
You must be signed in to change notification settings - Fork 19
diff window draws behind menu if diff is too large #1
Comments
I think using a separate virtual window for the diff makes sense. Then neovim could handle overlapping, limiting size and even could make it scrollable and all those virtual window GUI features. There is no need to reimplement GUI elements that are builtin. If all three 'subwindows' were their own virtual windows, then neovim could also handle the borders (including user customizability) for you |
I'm a little confused. These are actual three different windows. Did you misinterpreted that or do I simply not understand what you mean? 😂 |
Ah no I misunderstood your post, because you said 'Extra window for diff summary and preview'. I think then just cropping it is okay? How often do you have code actions with diffs more than half a page anyway. Also side-by-side diffs would be more height efficient, and word diffs would be the most compact. So those would be interesting to look at |
😂 Just to make it 100% sure and void any kind of misunderstandig: there are three different windows open per default: the menu-, the details- and the diff-window. All of them are "actual" windows with their own buffer, border etc. pp
Yes. And then have mappings on the menu window to scroll the diff window? 🤔
Hmm. Though the squares plane size remains the same, I don't think this works well on most displays. |
Just chiming in, I think it would be good to have a configurable mapping for this. For example, nvim-cmp allows you to do exactly this. ['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }), Very useful, I use it all the time. |
Self report 😬
So if someone stumbles over it, this is already known. I'm open for suggestions whats the best solution for this issue.
It is possible to calculate the maximum height for the diff window. The question is then what to do with the content. A simple solution would be to limit the height to this maximum and then add mappings to the menu to scroll the preview. What I don't like about it, is that the user can't easily see that the diff is bigger or not.
It would be also nice to have the diff summary (means the files affected with how many changes) to be always present, no matter how large the diff is. The question would be how to arrange this... Folds? Extra window for diff summary and preview? ...
The text was updated successfully, but these errors were encountered: