New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New instance improvements #653
Conversation
main_get_persistent_argv() returns the (reproduced) options which should be passed to a new window.
Since the executable is not a directory, renamed utils_resource_dir() to the more generic utils_resource_path(), and RESOURCE_DIR_DATA to RESOURCE_PATH_DATA_DIR etc.
Windows only: also fix the locale filename support. The standard utils_get_locale_from_utf8() does nothing, because it targets the glib filename encoding, which is UTF-8. g_locale_from_utf8() must be used.
Now, a few words about app->confdir under *nix. Geany assigns "app->confdir = alternate_config", and then in setup_config_dir() does "SETPTR(app->configdir, utils_get_locale_from_utf8(app->configdir))", freeing app->confdir, and thus alternate_config, leading to buggy reproduced option for New Window. The original SM code counters this by "app->confdir = g_strdup(alternate_config)", but in my tests with a -c locale_dir under Linux:
It seems to me then that the proper fix will be (a) not to convert app->configdir to locale, and (b) use an UTF-8 converted string for geany_debug(). I tried that, and it works on my system (bg_BG). So my questions are:
|
Hmm, there's one more bug: Geany executable is checked for being valid each time utils_resource_path() is invoked. I'll fix this soon. It's in the last commit, is it OK to replace it? |
Fixed Geany executable to be checked only once. The bug wasn't in the last commit, so I'm not force-replacing it, but issuing a new one. |
Since app->confdir is usually initialized with the dynamically allocated utils_get_user_config_dir(), and is gfree-d, using g_strdup(alternate_config) seems ok, and the confdir locale issue should be fixed separatedly. |
Fixed configdir encoding in PR #658 |
Closing since this hasn't been touched in almost 4 years and AFAIK @zhekov is no longer using Geany as his main editor. Feel free to re-open if anyone wants to pick up working on this. |
This is an improved version of PR #637.
No more "--" - not needed.
No guard for is_osx_bundle() under Windows - does not belong here.
Split into proper sequential commits.
Fixed the encoding of options and doc_name.
Fixed the OSX bundle executable name.
Created a function to return the reproduced arguments instead of exposing global variables.
Re-tested under Windows and Linux.
There is only one problem left. As described in PR #637, under Windows, mscvrt often breaks unquoted locale strings on 2+ pieces, considering some characters "spaces". So spawn should quote any argv elements containing locale. But that must obviously be a separate PR.