Closed Glirastes closed 1 year ago
@Glirastes Hi :) Thanks for this report.
What behavior checks are you basing your determination that the settings.toml is not sourced on?
@akiyosi I designed the config shown above to very clearly indicate to me if it's applied or not. Note that I have never used TOML before, but I think the syntax should be correct.
My Observation was that Goneovim looks and behaves exactly the same, whether the config is present or not. Specifically (view config above):
Based on that I am quite certain that the contents of my config do not apply. Also, looking at the logfile, reading the config consumes no time at all, isn't that a very clear indicator aswell? Thanks for your help. I feel embarrassed about this, since it's a somewhat big repo and apparently no one else has this trivial problem, but the path to the config really conforms to what is described in the Wiki / helpfiles.
I'm sorry. The documentation was wrong.
In Windows, the configuration file adopts the same location as MacOS and Linux when %XDG_CONFIG_HOME%
is defined, and it is customary to set %LOCALAPPDATA%
as %XDG_CONFIG_HOME%
in Windows.
However, %XDG_CONFIG_HOME%
is not usually defined on Windows. In this case,
the configuration directory is detected in the following order in Windows
%USERPROFILE%\.condig\goneovim\settings.toml
%USERPROFILE%\.goneovim\settings.toml
You will either define %XDG_CONFIG_HOME%
or create a configuration directory under %USERPROFILE%
.
Hey, I have the same issue, and trying to use Goneovim from long time, but could not for this reason. I tried both the paths above
%USERPROFILE%\.condig\goneovim\settings.toml
%USERPROFILE%\.goneovim\settings.toml
but none of them worked for me. I used the same config as used in the description above.
@akiyosi
Thanks. Setting the environment variable did indeed fix it.
However I also tried out the other two paths and did not manage to get the config sourced consistently. Upon further testing I concluded, that the presence of the directories themselves also plays a critical role (which I think is not the desired logic, at least I find it highly unusual and confusing).
I tested every combination of the three directories (present or not) and the environment variable %XDG_CONFIG_HOME%
(set to %LOCALAPPDATA%
or not present), below are the results.
a) %LOCALAPPDATA%\goneovim\
b) %USERPROFILE%\.config\goneovim\
c) %USERPROFILE%\.goneovim\
The config was only present in one of the three directories at a time, indicated by the first column. The environment variable was either explicitly set to
%LOCALAPPDATA%
or not at all, indicated by the second column.
Based on these results, the logic seems to be something like the following pseudo-code (haven't looked at the actual code):
if (%XDG_CONFIG_HOME% set){
if (%XDG_CONFIG_HOME%/goneovim/ exists){
if (config in there) { source it }
}
else if (%USERPROFILE%/.goneovim/ exists){
if (config in there) { source it }
}
}
else{
if (%USERPROFILE%/.config/goneovim/ exists){
if (config in there) { source it }
}
else if (%USERPROFILE%/.goneovim/ exists){
if (config in there) { source it }
}
}
I think the behaviour for vimrc in (Neo)vim is to look for the file in every directory and only stop, if either a vimrc is found or all present directories do not contain one. I would find that behaviour intuitive for Goneovim as well. Not something critical for now though.
@aloknigam247 Looking at the above image, you should also be able to get it to work.
@Glirastes Thanks for the test! In fact, the implementation is as follows:
https://github.com/akiyosi/goneovim/blob/master/editor/config.go#L168-L177
If there is a more ideal logic, I will consider fixing it.
@Glirastes @akiyosi still I am not able to source the config. I made a syntax error in the config so that goneovim reports it. Still no error messages. Also, I checked this log is also not there in debug logs https://github.com/akiyosi/goneovim/blob/f3a185199b46e692a954af04aba1703d38af782a/editor/editor.go#L226
I installed goneovim using scoop. Not sure what is wrong here
goneovim is not working for me, but goneovim-nightly do works as expected
@aloknigam247 Why would you assume, that Goneovim reports a syntax error in the config? Depending on the severity of the syntax error, for me the effect is rather the opposite: The config does not get sourced anymore. You might want to consider testing a valid config that still allows you to determine if it was sourced or not.
And what do you mean when you say that nightly is working? The config or the log message? The latter was introduced in a recent commit, so that might be why you don't see it in the release version.
Did you set the XDG_CONFIG_HOME
user environment variable to %LOCALAPPDATA%
(restart might be needed after that) and is your config located under %LOCALAPPDATA%\goneovim\settings.toml
?
No I didn't assumed, I saw this code and thought it will print some error statement if I used an invalid toml file. https://github.com/akiyosi/goneovim/blob/f3a185199b46e692a954af04aba1703d38af782a/editor/config.go#LL188-L191C3
And the log below that I mentioned is also printed in the debug logs file.https://github.com/akiyosi/goneovim/blob/f3a185199b46e692a954af04aba1703d38af782a/editor/editor.go#L226
Yes I set the XDG_CONFIG_HOME
to LOCALAPPDATA
and other use cases as mentioned in https://github.com/akiyosi/goneovim/blob/master/editor/config.go#L168-L177.
So nightly is working as expected in my case., so using the nightly one.
If the current specifications are unsatisfactory, I would like some specific suggestions. If there is a better specification, I would like to improve it. If there are none, I would like to close this issue.
@akiyosi
As I said, I think it would be better to have a settings.toml
always sourced, no matter in which of the 3 directories it is located and no matter which of the other config directories are present (as long as they do not contain a settings.toml
themselves). Looking at the image I provided in this issue, that would mean that the rightmost column only contains checkmarks. So Goneovim would only stop searching if either a settings.toml
is found, or none of the three directories contains a settings.toml
.
I think this is universal behaviour in config logic, not only in Vim and Neovim, but especially since Goneovim is a Gui for Neovim, it would make sense to me to implement the same behaviour.
@Glirastes So you are saying that it should be source in all cases on the spreadsheet you summarized?
@akiyosi Yes exactly.
@Glirastes I have created a fix to improve detection of Windows config directories.
https://github.com/akiyosi/goneovim/commit/792b82f30f3334981e2e349f32fd11caff148672
Very busy atm, will check if it's working as expected when I have time (and eventually close this issue ;) ).
I don't think there is any problem, so I will merge them. Please re-open if you have any problems.
I'm running Windows 10 and am trying to configure Goneovim. However it seems that my config, located at
%LOCALAPPDATA%\goneovim\settings.toml
is not sourced. Path is correct, checked it dozens of times. Echoing the environment variables from inside Goneovim gives correct results. Installed Goneovim with scoop.Here is the tested config:
Goneovim did not change the slightest bit.
And here is the logfile (--debug was the only command line option given):