Hi! I installed the 32 bit version of jdTextEdit. It’s a very good editor. Lot of options, nice!
The only little problem that I found, is related to the Haiku Application menu shortcut. If I run it from the Terminal, works perfectly. But if I use from the “Applications” menu, I get the following error message:
“jdTextEdit is unable to create his data folder”
I guess it try to write in some read-only folder. It’s weird because if I run it from the same location, but using the Terminal, works without any issue.
This can be a common issue for some applications because the Terminal provides more environment variables than when applications are launched outside the terminal. Since this is a Python application that is what I would suspect. Maybe it is trying to find something under $HOME for example but $HOME is empty and then it tries to create something in the root of the system, which is read-only.
There is probably a way for it to be fixed in the code but JakobDev might need to look into that. Haiku does provide some APIs to look up common folder names which maybe would be better to do here.
I found the error. jdTextEdit ties to create his folder on a completely other place when it launches from the Menu. This directory doesn’t exists yet and jdTextEdit is unable to create sub directories in the current versions. This will be fixed in the future. In the mean time run this in the Terminak to fix the problem:
mkdir -p ~/.local/share
But it doesn’t fix the problem, that jdTextEdit uses a completely other directory when it is launched from the Terminal. It currently uses the following code to find the directory:
I think it uses XDG_DATA_HOME when it is launched from the Terminal. Have anyone a suggestion which folder I should use on Haiku?
Besides of that, I think it’s a big problem that Haiku launches programs with other environment vars if you start a program from Terminal or from Menu. That may affect more programs and is a thing that needs to be fixed.
home/config/settings/jdeditor/
Or:
home/config/jdeditor/
In Haiku you should avoid prefix with a dot (.config .data .settings)
If you use IRC you will get faster and better answers than here for short questions like:
Never though that this would cause be a long discussion. I’m not a Haiku developer but I still think having the same environment when launching from console and when launching from menu would be great. Whatever opinion you have about environment variables, it is fact that lots of programs using them, which needs to be extra patched for Haiku. But I think this should be discussed in a extra thread instead of here.
Anyways, Version 8.3 of jdTextEdit is now out. jdTextEdit now uses config/settings/jdTextEdit as directory. If you have any data in the old directories, just copy them into the new new folder. I also added line operations.
The current code has been uploaded to GitLab. Would be nice if somebody could test it before I make a release. The split view requires a lot of code rewrite, so there might be bugs left. You can split it with View>Split View. The saved sessions are not compatible with the new version. It’s the best to start jdTextEdit in portable mode (run with -p) which doesn’t effect your data to test it.
I also added a menu to add templates from the editor, so you doesn’t need to copy files in the template folder by yourself, what users might not know.
Having a dark Theme for the editor is possible. jdTextEdit has already a API for adding Themes.But the Theme need colors for each language jdTextEdit offers, which is a lot of work, and I’m not a designer. Converting Themesfrom other editors isalso not easy.