Skip to content

Commit

Permalink
adds ViewBufferLines to View
Browse files Browse the repository at this point in the history
  • Loading branch information
gulyasm authored and jroimartin committed Apr 11, 2018
1 parent 2cda4f9 commit c055c87
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions view.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,18 @@ func (v *View) Buffer() string {
return strings.Replace(str, "\x00", " ", -1)
}

// ViewBufferLines returns the lines in the view's internal
// buffer that is shown to the user.
func (v *View) ViewBufferLines() []string {
lines := make([]string, len(v.viewLines))
for i, l := range v.viewLines {
str := lineType(l.line).String()
str = strings.Replace(str, "\x00", " ", -1)
lines[i] = str
}
return lines
}

// 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 c055c87

Please sign in to comment.