Skip to content

Commit

Permalink
More accurate line count
Browse files Browse the repository at this point in the history
  • Loading branch information
zix99 committed Oct 21, 2020
1 parent d686c04 commit 6f978d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/multiterm/virtualterm.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (s *VirtualTerm) Get(line int) string {
}

func (s *VirtualTerm) LineCount() int {
return s.maxLine
return s.maxLine + 1
}

func (s *VirtualTerm) WriteToOutput(out io.Writer) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/multiterm/virtualterm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestVirtualTerm(t *testing.T) {

assert.Equal(t, "Hello", vt.Get(0))
assert.Equal(t, "", vt.Get(1))
assert.Equal(t, 2, vt.LineCount())
assert.Equal(t, 3, vt.LineCount())

vt.WriteToOutput(os.Stdout)
}

0 comments on commit 6f978d3

Please sign in to comment.