Open molsonkiko opened 1 month ago
Thanks for posting the issue. I think Notepad++ runs into other issues as well when opening such large >2GB files.
I'll look into this when I have the time. For now, I've updated the generate_data.py script to generate a cardio.txt
file of 2GB, if you change the TOTAL_LINES
variable.
To replicate
int.MaxValue
).Expected behavior
Obviously I expect no crash. I would also expect CSVLint to explain to the user that the file is too large for CSVLint to open whenever they manually run a plugin command.
Debug info
Proposed solution
The sneaky problem with the plugin infrastructure we use is that you can't even attempt to get the length of a file with length greater than
int.MaxValue
if theISCintillaGateway.GetLength()
method returns anint
. The obvious solution is to have the method return along
, but it's annoying to do bounds checking on thelong
every time, so the best solution is to have a helper method.I'm not going to submit a PR because I don't have the .NET Framework 4.0 targeting pack installed and I don't feel like installing it, but you can see how I changed JsonTools to fix this issue.
In short, you want to do the following:
ScintillaGateway
andIScintillaGateway
so that theGetLength()
method returns along
:add a helper method (and related global variable) to your
Main
class that does the bounds checking and (optionally) warns the user if the file is too big: