SpartanJ / ecode

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

[BUG][WINDOWS] Colorschemes not loading from %APPDATA% #301

Closed NullPlane closed 2 months ago

NullPlane commented 4 months ago

Since I wanted to update ecode and to date I managed colorschemes from the program path asset assets/colorschemes/colorschemes.conf I tried to move them to %APPDATA%/ecode/editor/colorschemes for the first time just as suggested here so I may just unzip the whole project and replace the old version.

This results in the windows not loading but staying black. There is no reasonable feedback to be extracted by --verbose or from the log — it seems to just stop after loading colorschemes.

2024-07-28 15:40:44 - INFO: eepp initialized
2024-07-28 15:40:44 - INFO: C:\Users\USERNAME\AppData\Roaming\ecode\config.cfg loaded in 0.28ms
2024-07-28 15:40:44 - INFO: C:\Users\USERNAME\AppData\Roaming\ecode\state.cfg loaded in 0.14ms
2024-07-28 15:40:44 - INFO: Plugin: Auto Complete loaded and ready from process 29992
2024-07-28 15:40:44 - INFO: Plugin: Auto Formatter loaded and ready from process 29992
2024-07-28 15:40:44 - INFO: Plugin: Linter loaded and ready from process 29992
2024-07-28 15:40:44 - INFO: Plugin: LSP Client loaded and ready from process 29992
2024-07-28 15:40:45 - INFO: Shader 2 compiled succesfully
2024-07-28 15:40:45 - INFO: Shader 3 compiled succesfully
2024-07-28 15:40:45 - INFO: Engine Initialized Succesfully.
    Version: eepp version 2.8.0 (codename: "Siddhi")
    Build time: Jul 20 2024 00:53:31
    Platform: Windows
    OS: Microsoft Windows 11
    Arch: x64
    CPU Cores: 12
    Process Path: C:\Expand\crupkg\ecode\
    Current Working Directory: C:\Users\USERNAME
    Disk Free Space: 197.66 GiB
    Window/Input Backend: SDL 2.30.3
    GL Backend: OpenGL 3
    GL Vendor: NVIDIA Corporation
    GL Renderer: NVIDIA GeForce GTX 1080/PCIe/SSE2
    GL Version: 4.6.0 NVIDIA 560.70
    GL Shading Language Version: 4.60 NVIDIA
    Resolution: 2560x1377
2024-07-28 15:40:45 - INFO: ecode version 0.6.0 (codename: "Prāpti") initializing
2024-07-28 15:40:45 - INFO: Window creation took: 379.68 ms
2024-07-28 15:40:45 - INFO: C:\Users\USERNAME\AppData\Roaming\ecode\keybindings.cfg loaded in 0.21ms
2024-07-28 15:40:45 - INFO: StyleSheet loaded in: 0.611 ms.
2024-07-28 15:40:45 - INFO: StyleSheet loaded in: 4.290 ms.
2024-07-28 15:40:45 - INFO: StyleSheet loaded in: 0.026 ms.
2024-07-28 15:40:45 - INFO: Syntax definitions loaded in 4.63 ms.
2024-07-28 15:40:45 - INFO: StyleSheet loaded in: 1.595 ms.
2024-07-28 15:40:45 - INFO: Texture ID 1 loaded in 2.079 ms.
2024-07-28 15:40:45 - INFO: Texture ID 2 loaded in 0.121 ms.
2024-07-28 15:40:45 - INFO: Texture ID 3 loaded in 0.451 ms.
2024-07-28 15:40:45 - INFO: Texture ID 4 loaded in 0.419 ms.
2024-07-28 15:40:45 - INFO: Texture ID 5 loaded in 0.272 ms.
2024-07-28 15:40:45 - INFO: Texture ID 6 loaded in 0.336 ms.
2024-07-28 15:40:45 - INFO: Texture ID 7 loaded in 0.124 ms.
2024-07-28 15:40:45 - INFO: Texture ID 8 loaded in 0.442 ms.
2024-07-28 15:40:45 - INFO: Texture ID 9 loaded in 0.178 ms.
2024-07-28 15:40:45 - INFO: Color Schemes loaded in 0.63ms.

The issue also occurred before 0.6.0 so it is not release-specific. The scheme section works flawlessly if added into assets/colorschemes/colorschemes.conf

SpartanJ commented 4 months ago

I'm unable to reproduce it. Could you please share your complete non-working %APPDATA%/ecode directory? BTW you don't need to move all the original color schemes, they will still be present if you add any new color scheme. Duplicating them will just replace the original ones.

NullPlane commented 4 months ago

Update for the issue — memory leak

Left it to try loading for a while and then I realized my browser crashing and some system UI components invisible so I immediately knew what happened.

https://github.com/user-attachments/assets/a8ab9351-8507-4a7c-94e0-7e5c29eff472

Here you may get the archive from %APPDATA%/ecode.

[!note] EDIT Removed link since resolution

SpartanJ commented 4 months ago

Oh great thanks. This was a bug in the ini parser. I already pushed a fix. The problem happens when the file does not end with a new line. So for now you can just add an empty new line to your color schemes and it will work.

NullPlane commented 4 months ago

As simple as it gets. Great. Ty.