From 96afdf6368705385de861599052adf3d7ae3bace Mon Sep 17 00:00:00 2001 From: Caleb Foust Date: Sat, 18 Nov 2023 06:53:28 -0500 Subject: [PATCH] fix: clearing single lines --- pkg/emu/state.go | 4 ++-- pkg/sessions/search/search_test.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/emu/state.go b/pkg/emu/state.go index 0ff76158..96ba8604 100644 --- a/pkg/emu/state.go +++ b/pkg/emu/state.go @@ -365,8 +365,8 @@ func (t *State) clear(x0, y0, x1, y1 int) { C: x0, }, Size: geom.Vec2{ - R: y1 - y0, - C: x1 - x0, + R: y1 - y0 + 1, + C: x1 - x0 + 1, }, } } diff --git a/pkg/sessions/search/search_test.go b/pkg/sessions/search/search_test.go index 5d25e768..996befa7 100644 --- a/pkg/sessions/search/search_test.go +++ b/pkg/sessions/search/search_test.go @@ -129,7 +129,8 @@ func TestClearLine(t *testing.T) { "baz", ). Term(terminfo.CursorAddress, 0, 0). - Term(terminfo.DeleteLine) + Term(terminfo.ClrEol). + Add("baz") results, err := Search(sim.Events(), "foo", nil) require.NoError(t, err)