We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 912d216 commit 7d13ae0Copy full SHA for 7d13ae0
viewport/viewport.go
@@ -181,6 +181,7 @@ func (m Model) HorizontalScrollPercent() float64 {
181
}
182
183
// SetContent set the pager's text content.
184
+// Line endings will be normalized to '\n'.
185
func (m *Model) SetContent(s string) {
186
s = strings.ReplaceAll(s, "\r\n", "\n") // normalize line endings
187
m.lines = strings.Split(s, "\n")
@@ -197,6 +198,8 @@ func (m *Model) SetContent(s string) {
197
198
199
200
201
+// GetContent returns the entire content as a single string.
202
+// Line endings are normalized to '\n'.
203
func (m Model) GetContent() string {
204
return strings.Join(m.lines, "\n")
205
0 commit comments