Simplify UpdateDiff() interface

The callback passed to UpdateDiff() is superfluous: in the synchronous
case screen.Redraw() is not needed anyway (since the screen is redrawn
at every iteration of the main loop), and in the asynchronous case
UpdateDiff() can just call screen.Redraw() directly.
This commit is contained in:
Dmytro Maluka
2024-05-12 20:02:51 +02:00
parent 1f51d0b9e2
commit bca35a5939
3 changed files with 6 additions and 27 deletions

View File

@@ -1480,9 +1480,7 @@ func (h *BufPane) HalfPageDown() bool {
func (h *BufPane) ToggleDiffGutter() bool {
if !h.Buf.Settings["diffgutter"].(bool) {
h.Buf.Settings["diffgutter"] = true
h.Buf.UpdateDiff(func(synchronous bool) {
screen.Redraw()
})
h.Buf.UpdateDiff()
InfoBar.Message("Enabled diff gutter")
} else {
h.Buf.Settings["diffgutter"] = false