Skip to content

Commit

Permalink
Merge pull request #644 from noborus/filter-header
Browse files Browse the repository at this point in the history
Fix linkage of filter documents with headers
  • Loading branch information
noborus authored Oct 30, 2024
2 parents d736170 + 7c7eb8f commit 567af05
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion oviewer/doclist.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,14 @@ func (root *Root) nextDoc(ctx context.Context) {
func (root *Root) previousDoc(ctx context.Context) {
fromNum := root.CurrentDoc
fromDoc := root.getDocument(fromNum)
if fromDoc == nil {
return
}
toNum := root.CurrentDoc - 1
toDoc := root.getDocument(toNum)
if toDoc == nil {
return
}

root.setDocumentNum(ctx, toNum)
root.input.Event = normal()
Expand All @@ -135,7 +141,7 @@ func (root *Root) linkLineNum(fromDoc, toDoc *Document) {
}
if n, ok := fromDoc.lineNumMap.LoadForward(fromDoc.topLN + fromDoc.firstLine()); ok {
root.debugMessage("Move parent line number")
toDoc.moveLine(n)
toDoc.moveLine(n - toDoc.firstLine())
}
}

Expand Down

0 comments on commit 567af05

Please sign in to comment.