Skip to content

Commit

Permalink
View: Added ViewLinesHeight()
Browse files Browse the repository at this point in the history
 * This might be usefull for people who want to check that

See jesseduffield@e030e03

Co-authored-by: Jesse Duffield <jessedduffield@gmail.com>
Signed-off-by: Glenn Vriesman <glenn.vriesman@gmail.com>
  • Loading branch information
glvr182 and jesseduffield committed Sep 10, 2019
1 parent d0b5cfa commit da1361c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions view.go
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,16 @@ func (v *View) ViewBufferLines() []string {
return lines
}

// LinesHeight is the count of view lines (i.e. lines excluding wrapping)
func (v *View) LinesHeight() int {
return len(v.lines)
}

// ViewLinesHeight is the count of view lines (i.e. lines including wrapping)
func (v *View) ViewLinesHeight() int {
return len(v.viewLines)
}

// ViewBuffer returns a string with the contents of the view's buffer that is
// shown to the user.
func (v *View) ViewBuffer() string {
Expand Down

0 comments on commit da1361c

Please sign in to comment.