The old method of catching access violations when loading, to detect that file is too large, does not work with latest Scintilla. This patch uses SCI_GETSTATUS to verify that Scintilla was able to add the text to its buffers. It also allocates memory before starting to load file to detect insufficient memory early, reduce memory fragmentation, and speedup loading.
It has been tested to load correctly 512MiB file on my system, while 5.7.1RC was truncating a 200MiB file without warning. It has also been tested to display immediately (before reading whole file) an error when trying to load a 1GiB file.