SpartanJ / ecode

Lightweight multi-platform code editor designed for modern hardware with a focus on responsiveness and performance.
MIT License
938 stars 13 forks source link

New folder bug #306

Closed Curculigo closed 2 months ago

Curculigo commented 3 months ago

I created a new folder on the Open Folder dialog. The new folder is created and I can select it. But after the dialog is closed, there is still a dialog asking for the new folder's name (with the folder name I have previously created) even though everything is already done on the Open Folder dialog. If I click OK then ecode crashes. On the terminal, it printed Bus error.

p/s: FreeBSD, using your build.

Curculigo commented 3 months ago

A new and strange folder is created on the ecode directory (where ecode.bin is).

The name of the folder starts with a space character: hover.

Curculigo commented 3 months ago

It turned out that what it opened is the parent folder, not the new folder I created. Recent folders confirmed this.

SpartanJ commented 3 months ago

I created a new folder on the Open Folder dialog. The new folder is created and I can select it. But after the dialog is closed, there is still a dialog asking for the new folder's name (with the folder name I have previously created) even though everything is already done on the Open Folder dialog.

I can reproduce this by pressing enter to confirm the name (instead of the button). This will NOT close the window and keep the window open but create the folder.

If I click OK then ecode crashes. On the terminal, it printed Bus error.

Yes, it will crash if you close the File Dialog because it will lose the parent. Closing the window after press enter will fix the issue.

A new and strange folder is created on the ecode directory (where ecode.bin is).

This i'm not sure, my guess is that you confirmed the folder creation twice and it was created with corrupted memory since the instance of the parent was already destroyed, so created the folder and then crashed.

It turned out that what it opened is the parent folder, not the new folder I created. Recent folders confirmed this.

I think this is because after creating a folder it does not select it, so if you open without selection it will open the current folder. I'll auto-select the created folder to avoid any confusion.