respect range limit when selecting all text
This commit is contained in:
@@ -79,6 +79,18 @@ class LogFileModel:
|
||||
target.write(buffer)
|
||||
offset = new_offset
|
||||
|
||||
def get_line_start_at(self, byte_offset: int) -> int:
|
||||
lines = self.data(byte_offset, 0, 1, 0, -1);
|
||||
if len(lines) == 0:
|
||||
return 0
|
||||
return lines[0].byte_offset()
|
||||
|
||||
def get_line_end_at(self, byte_offset: int) -> int:
|
||||
lines = self.data(byte_offset, 0, 1, 0, -1);
|
||||
if len(lines) == 0:
|
||||
return 0
|
||||
return lines[0].byte_end()
|
||||
|
||||
def read_word_at(self, byte_offset: int) -> (str, int, int):
|
||||
lines = self.data(byte_offset, 0, 1, 0, -1)
|
||||
if len(lines) == 0:
|
||||
|
||||
Reference in New Issue
Block a user