mirror of
https://github.com/jroimartin/gocui.git
synced 2025-04-24 13:48:51 +08:00
adds ViewBufferLines to View
This commit is contained in:
parent
2cda4f9f05
commit
c055c87ae8
12
view.go
12
view.go
@ -430,6 +430,18 @@ func (v *View) Buffer() string {
|
|||||||
return strings.Replace(str, "\x00", " ", -1)
|
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
|
// ViewBuffer returns a string with the contents of the view's buffer that is
|
||||||
// shown to the user.
|
// shown to the user.
|
||||||
func (v *View) ViewBuffer() string {
|
func (v *View) ViewBuffer() string {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user