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 538d39c commit 93a004aCopy full SHA for 93a004a
viewport/viewport.go
@@ -240,8 +240,11 @@ func (m *Model) SetContentLines(lines []string) {
240
// iterate in reverse, so we can safely modify the slice.
241
var subLines []string
242
for i := len(m.lines) - 1; i >= 0; i-- {
243
- m.lines[i] = strings.ReplaceAll(m.lines[i], "\r\n", "\n") // normalize line endings
+ if !strings.ContainsAny(m.lines[i], "\r\n") {
244
+ continue
245
+ }
246
247
+ m.lines[i] = strings.ReplaceAll(m.lines[i], "\r\n", "\n") // normalize line endings
248
subLines = strings.Split(m.lines[i], "\n")
249
if len(subLines) > 1 {
250
m.lines = slices.Insert(m.lines, i+1, subLines[1:]...)
0 commit comments