diff --git a/buffer/buffer.go b/buffer/buffer.go index 57a7b35..201931a 100644 --- a/buffer/buffer.go +++ b/buffer/buffer.go @@ -874,7 +874,7 @@ func (buffer *Buffer) Clear() { } func (buffer *Buffer) ReallyClear() { - defer buffer.emitDisplayChange() + defer buffer.dirty.Notify() buffer.lines = []Line{} buffer.terminalState.SetScrollOffset(0) buffer.SetPosition(0, 0) diff --git a/gui/gui.go b/gui/gui.go index 0af42eb..c3e4ffa 100644 --- a/gui/gui.go +++ b/gui/gui.go @@ -436,7 +436,7 @@ func (gui *GUI) Render() error { go gui.waker(stop) for !gui.window.ShouldClose() { - gui.redraw() + gui.redraw(true) if gui.showDebugInfo { gui.textbox(2, 2, fmt.Sprintf(`Cursor: %d,%d diff --git a/gui/input.go b/gui/input.go index c5caada..ec7b65e 100644 --- a/gui/input.go +++ b/gui/input.go @@ -52,7 +52,7 @@ func (gui *GUI) updateSelectionMode(mods glfw.ModifierKey) { } if gui.selectionRegionMode != mode { gui.selectionRegionMode = mode - gui.terminal.SetDirty() + gui.terminal.NotifyDirty() } } diff --git a/terminal/terminal.go b/terminal/terminal.go index 1c50074..989ebd9 100644 --- a/terminal/terminal.go +++ b/terminal/terminal.go @@ -436,12 +436,3 @@ func (terminal *Terminal) Lock() { func (terminal *Terminal) Unlock() { terminal.lock.Unlock() } - -// SetDirtyLocked sets dirty flag locking the terminal to prevent data race warnings -// @todo remove when switching to event-driven architecture -func (terminal *Terminal) SetDirtyLocked() { - terminal.Lock() - defer terminal.Unlock() - - terminal.SetDirty() -}