(linePtr *LinePtr)
| 82 | } |
| 83 | |
| 84 | func (lv *LogView) NextLinePtr(linePtr *LinePtr) (*LinePtr, error) { |
| 85 | if linePtr == nil { |
| 86 | return nil, fmt.Errorf("linePtr is nil") |
| 87 | } |
| 88 | numLines := int64(0) |
| 89 | offset := linePtr.Offset |
| 90 | for { |
| 91 | var err error |
| 92 | nextOffset, err := lv.MultiBuf.NextLine(offset) |
| 93 | if err == io.EOF { |
| 94 | return nil, nil |
| 95 | } |
| 96 | if err != nil { |
| 97 | return nil, err |
| 98 | } |
| 99 | numLines++ |
| 100 | if lv.isLineMatch(nextOffset) { |
| 101 | return &LinePtr{Offset: nextOffset, RealLineNum: linePtr.RealLineNum + numLines, LineNum: linePtr.LineNum + 1}, nil |
| 102 | } |
| 103 | offset = nextOffset |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | func (lv *LogView) PrevLinePtr(linePtr *LinePtr) (*LinePtr, error) { |
| 108 | if linePtr == nil { |
no test coverage detected