Skip to content

Commit

Permalink
Adjust start when using section-header
Browse files Browse the repository at this point in the history
Adjust start when using section-header when writeOriginal.
  • Loading branch information
noborus committed Oct 11, 2023
1 parent 10393ef commit a0be5f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oviewer/oviewer.go
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ func (root *Root) WriteOriginal() {
m.bottomLN = m.BufEndNum()
}

start := max(0, m.topLN-root.BeforeWriteOriginal)
start := max(0, m.topLN-(m.sectionHeaderNum+root.BeforeWriteOriginal))
end := m.bottomLN - 1
if root.AfterWriteOriginal != 0 {
end = m.topLN + root.AfterWriteOriginal - 1
Expand Down

0 comments on commit a0be5f2

Please sign in to comment.