Code tidy

This commit is contained in:
Luke Wilson 2021-04-13 11:32:22 -05:00
parent 2755630929
commit 06d12b0415

View File

@ -108,15 +108,13 @@ func (h *Highlighter) updateLines(startLine, endLine int) {
indexes = k.Start.FindAllIndex(bytes, -1) // Attempt to find the start match indexes = k.Start.FindAllIndex(bytes, -1) // Attempt to find the start match
} }
if indexes != nil { for i := range indexes {
for i := range indexes { startLine, startCol := h.Buffer.PosToLineCol(indexes[i][0] + startPos)
startLine, startCol := h.Buffer.PosToLineCol(indexes[i][0] + startPos) endLine, endCol := h.Buffer.PosToLineCol(indexes[i][1] - 1 + startPos)
endLine, endCol := h.Buffer.PosToLineCol(indexes[i][1] - 1 + startPos)
match := Match{startCol, endLine, endCol, v} match := Match{startCol, endLine, endCol, v}
h.lineMatches[startLine] = append(h.lineMatches[startLine], match) // Unsorted h.lineMatches[startLine] = append(h.lineMatches[startLine], match) // Unsorted
}
} }
} }