Skip to content

Commit 7d13ae0

Browse files
committed
docs: godoc
1 parent 912d216 commit 7d13ae0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

viewport/viewport.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ func (m Model) HorizontalScrollPercent() float64 {
181181
}
182182

183183
// SetContent set the pager's text content.
184+
// Line endings will be normalized to '\n'.
184185
func (m *Model) SetContent(s string) {
185186
s = strings.ReplaceAll(s, "\r\n", "\n") // normalize line endings
186187
m.lines = strings.Split(s, "\n")
@@ -197,6 +198,8 @@ func (m *Model) SetContent(s string) {
197198
}
198199
}
199200

201+
// GetContent returns the entire content as a single string.
202+
// Line endings are normalized to '\n'.
200203
func (m Model) GetContent() string {
201204
return strings.Join(m.lines, "\n")
202205
}

0 commit comments

Comments
 (0)