Skip to content

Commit

Permalink
Merge pull request #433 from noborus/improved-export
Browse files Browse the repository at this point in the history
improved Export
  • Loading branch information
noborus authored Aug 17, 2023
2 parents 06c7f69 + 1ef5e52 commit dccf4f1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions oviewer/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,9 @@ func (m *Document) CurrentLN() int {

// Export exports the document in the specified range.
func (m *Document) Export(w io.Writer, start int, end int) {
end = min(end, m.BufEndNum()-1)
for n := start; n <= end; n++ {
if n >= m.BufEndNum() {
break
}
fmt.Fprintln(w, m.LineString(n))
fmt.Fprintln(w, m.GetLine(n))
}
}

Expand Down

0 comments on commit dccf4f1

Please sign in to comment.