ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Deozaan's Simple Text Editor

<< < (2/2)

wraith808:
This is designed for plaintext only. But it probably shouldn't crash when an unsupported format is loaded. Upon further investigation, it looks like I made a mistake in attempting to gracefully handle errors when loading files. It was confusing because printing the error (which is an integer) to the debug log will automatically convert it to a string. But I attempted to add a more helpful message to the log and concatenate the error to the message, not realizing that string concatenation doesn't automatically cast the integers to strings.

-Deozaan (March 20, 2021, 02:35 AM)
--- End quote ---

Can you limit the extensions to *.txt only? That's a clear sign that it's a text editor for the purposes of this small test, since you didn't really intend it for anything.

Deozaan:
This is designed for plaintext only. But it probably shouldn't crash when an unsupported format is loaded. Upon further investigation, it looks like I made a mistake in attempting to gracefully handle errors when loading files. It was confusing because printing the error (which is an integer) to the debug log will automatically convert it to a string. But I attempted to add a more helpful message to the log and concatenate the error to the message, not realizing that string concatenation doesn't automatically cast the integers to strings.

-Deozaan (March 20, 2021, 02:35 AM)
--- End quote ---

Can you limit the extensions to *.txt only? That's a clear sign that it's a text editor for the purposes of this small test, since you didn't really intend it for anything.
-wraith808 (March 20, 2021, 09:05 AM)
--- End quote ---

I can do that. I just chose not to because not all plaintext files end in .txt extension, such as .ini, .log, .json, etc. This is especially true on different platforms such as Linux, which often has plaintext files with no extension at all. That said, this thread has convinced me to reconsider, and I will set it to filter *.txt by default. The problem is that it will still allow you to select *.* from the dropdown, so if you do that and try to load an incompatible file type, it could potentially still crash/lock the program.

Deozaan's Simple Text Editor

Opening Microsoft Word files = Application Crash.-KodeZwerg (March 19, 2021, 06:26 PM)
--- End quote ---
But it probably shouldn't crash when an unsupported format is loaded.
I believe I've got this fixed for the new release.
-Deozaan (March 20, 2021, 02:35 AM)
--- End quote ---

Bad news.
On more testing, more things happen.
Errorhandling should be improved.
I did try open files that are not supposed to be opened by your program.
Program will freeze and can not be restarted after I terminate process.
I needed to go into my /user/.... folder and delete prefs.dat and logs folder, otherwise program is not able to run anymore. It simply does nothing.
My suggestion: limit file dialog filter to *.txt and not *.*.
-KodeZwerg (March 20, 2021, 06:53 AM)
--- End quote ---

I've just experimented with a bunch of different file types and filesizes. I've made some improvements that should allow it to fail faster. But in the process I've discovered that it can still take a very long time to parse a large text file. That is, I've successfully (failed) loading an invalid 385 MB zip file almost instantly. But attempting to load a valid 128 MB text file locks up the application while it attempts to parse the string data and display it. Presumably if you wait around long enough it will recover and eventually display it. After a few tests trying to open incompatible filetypes of various filesizes, the final one which was only about 11.5 MB and had me waiting about 50 minutes before it recovered (this was before I fixed things to fail faster), I decided I didn't have the patience to see how long it would take to open the 128 MB text file.

I think my changes to fail faster will also fix the program being unable to run again if the process is terminated, since it now reads the bytes from the file system very quickly and closes the file before attempting to parse the bytes into a readable/displayable string.

And finally, I've added a dialog which warns you when you're about to open a large file and makes sure you really want to do it. I have arbitrarily decided to warn only for files larger than 8 MB. Though that may still be too large. The smallest large text file I could find was ~37.5 MB and it locked up the program for longer than I ever bothered waiting before terminating the process. Hopefully 8 MB isn't too bad.

Deozaan's Simple Text Editor

Program messes around with my Registry/NVidia/OpenGL settings by creating keys.-KodeZwerg (March 19, 2021, 06:26 PM)
--- End quote ---
But if you can tell me what changes it makes I can look into whether or not I can prevent that from happening.
-Deozaan (March 20, 2021, 02:35 AM)
--- End quote ---
That is okay. You do not have possibilites to avoid such, that is the used 3d-Engine.
-KodeZwerg (March 20, 2021, 06:53 AM)
--- End quote ---

This looks to me like it is your GPU reading/writing stuff, because Godot requests access to have the GPU render things.


Everything is a bit too dark. Dark Menu on Dark Background... (maybe add a lightgray border to have it more seperated)-KodeZwerg (March 19, 2021, 06:26 PM)
--- End quote ---
Can you be more specific about this? Yes, the backgrounds are dark, but the foreground text is light, which should result in decent contrast and easy readability.
-Deozaan (March 20, 2021, 02:35 AM)
--- End quote ---
If Border would be lightgray from menu, the visual content would not look "melted" (?)
-KodeZwerg (March 20, 2021, 06:53 AM)
--- End quote ---

I still don't see the problem here. When you click a menu, you expect the options to show up below it. They do. Each option is clearly visible and blocks out the content behind it. Unless I'm missing a vital problem that you're trying to communicate to me, I think I'm going to chalk this one up to personal preference and say I don't intend to fix it, since it would require delving into customizing the theme.

FYI I didn't choose the color scheme. I pretty much just used the default colors for Godot's UI controls.

Deozaan's Simple Text Editor

You can find v1.210320.1 on my KeyBase: https://keybase.pub/deozaan/SimpleTextEditor/

Jotti report.
VirusTotal report.

Navigation

[0] Message Index

[*] Previous page

Go to full version