ForEachLine added
This commit is contained in:
parent
d7ab9285e1
commit
157e4f302d
@ -65,6 +65,13 @@ func (b *Buffer[T]) Height() int {
|
||||
return b.height
|
||||
}
|
||||
|
||||
// ForEach calls f for every value in this buffer
|
||||
func (b *Buffer[T]) ForEachLine(f func(line int, content []T)) {
|
||||
for line, content := range b.data {
|
||||
f(line, content)
|
||||
}
|
||||
}
|
||||
|
||||
// ForEach calls f for every value in this buffer
|
||||
func (b *Buffer[T]) ForEach(f func(x, y int, v T)) {
|
||||
for y, col := range b.data {
|
||||
|
Loading…
Reference in New Issue
Block a user