improve highlighting
This commit is contained in:
@@ -2,6 +2,8 @@ from typing import List
|
||||
import os
|
||||
from line import Line
|
||||
|
||||
from settings import Settings
|
||||
|
||||
|
||||
class LogFileModel:
|
||||
def __init__(self, file):
|
||||
@@ -12,8 +14,8 @@ class LogFileModel:
|
||||
|
||||
# TODO handle lines longer than 4096 bytes
|
||||
with open(self._file, 'r') as f:
|
||||
offset = max(0, byte_offset - 4096)
|
||||
offset = offset - offset % 4096 # align to blocks of 4kb
|
||||
offset = max(0, byte_offset - Settings.max_line_length())
|
||||
offset = offset - offset % Settings.max_line_length() # align to blocks of 4kb
|
||||
f.seek(offset)
|
||||
while l := f.readline():
|
||||
new_offset = f.tell()
|
||||
|
||||
Reference in New Issue
Block a user