Bug fix for read by line. (#10161)

Needs to pass -1 not Nothing to JSON.
This commit is contained in:
James Dunkerley 2024-06-03 22:33:45 +01:00 committed by GitHub
parent 1b60e2531f
commit f1a1901058
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,6 +13,7 @@ from project.Data.Boolean import Boolean, False, True
from project.Data.Range.Extensions import all
from project.Data.Text.Extensions import all
from project.Logging import all
from project.Metadata import Display, Widget
polyglot java import java.io.File as Java_File
polyglot java import java.nio.charset.Charset
@ -87,7 +88,7 @@ type File_By_Line
Returns the lines in the file as a vector.
to_vector : Vector Text
to_vector self = File_Error.handle_java_exceptions self.file <|
end_at = if self.limit_lines.is_nothing then Nothing else self.limit_lines-1
end_at = if self.limit_lines.is_nothing then -1 else self.limit_lines-1
FileLineReader.readLines self.java_file self.file_end self.row_map 0 end_at self.charset self.filter_func
## ICON parse3
@ -171,6 +172,7 @@ type File_By_Line
Arguments:
- predicate: The predicate to filter by.
@predicate (Widget.Text_Input display=Display.Always)
filter : Text | (Text -> Boolean) -> File_By_Line
filter self predicate =
## Create the predicate