micro/internal/display
Dmytro Maluka dcdd3e749a
Fix ruler overwriting neighboring split pane + fix crash #3052 (#3069)
* Fix gutter overwriting other split pane

When we resize a split pane to a very small width, so that the gutter
does not fit in the pane, it overwrites the sibling split pane.

To fix it, clean up the calculation of gutter width, buffer width and
scrollbar width, so that they add up exactly to the window width, and
ensure that we don't draw the gutter beyond this calculated gutter
width (gutterOffset).

As a bonus, this also fixes the crash #3052 (observed when resizing a
split pane to a very small width, if wordwrap is enabled), by ensuring
that bufWidth is never negative.

[*] By the gutter we mean of course gutter + diffgutter + ruler.

* Don't display line numbers if buffer width is 0 and softwrap is on

If softwrap is enabled, the line numbers displayed in the ruler depend
on the heights of the displayed softwrapped lines, which depend on the
width of the displayed buffer. If this width is 0 (e.g. after resizing
buffer pane to a very small width), there is no displayed text at all,
so line numbers don't make sense. So don't display line numbers in this
case.

* Fix buffer text overwriting scrollbar when window width is 1 char
2024-03-13 21:11:04 +01:00
..
bufwindow.go Fix ruler overwriting neighboring split pane + fix crash #3052 (#3069) 2024-03-13 21:11:04 +01:00
infowindow.go Add statusline.inactive and statusline.suggestions color groups (#1832) 2023-03-13 16:18:44 -07:00
softwrap.go Fix relocate at the end of buffer when scrollmargin is 0 (#2578) 2022-10-01 13:03:40 -07:00
statusline.go plugins: Add capability to dis-/enable them per buffer (#2836) 2023-06-05 17:38:33 -07:00
tabwindow.go Adds options for tab bar and tab color reversing (#2480) 2022-07-17 12:18:11 -07:00
termwindow.go termwindow: Show cursor only when his X and Y axis is smaller than the window (#3036) 2024-03-13 20:58:44 +01:00
uiwindow.go Fix non-working split resize with mouse drag (#1811) 2020-08-04 18:37:19 -04:00
window.go Replace BufWidth & BufHeight with BufView 2021-04-08 23:54:18 +02:00