Closed daedroza closed 2 years ago
Hi, Let me check on your problem.
When you say colorcolumn doesn't work, do you mean that it doesn't display? Does it always not show up, or does it sometimes show up, but at some point it doesn't?
Also, on the other hand, I haven't been able to reproduce the problem you reported, but in the process of investigating this issue, I found a problem where part of the colorcolumn is not displayed when there are wrapped lines during scrolling. This problem I found has been fixed, and the fixed version can be found below.
Hi, I use the following piece of code to initialize my color column.
if &co > 80
set colorcolumn=80
endif
As per my understanding, the co value returned when the goneovim instance starts is less than 80, hence set colorcolumn doesn't get set even when running it maximized. Manually setting it using :set colorcolumn=80 works.
Additionally, SmoothScroll=true doesn't work either, as if my the ~/.config/goneovim/settings.toml is never read. Here is the values of settings.toml:
[Editor]
Clipboard = true
IndentGuide = true
SmoothScroll = true
[ScrollBar]
Visible = true
Apologies for introducing another problem in the same issue. I've attached log for the same. debug.log
Also tried the build you shared, the artifacts section had 5.14.1 version and the issue doesn't seem to be resolved, I believe it's separate issue.
Thank you for presenting the additional information and the debug.log.
I have tried to reproduce the problem by running the following, but have not been able to do so. In other words, when I run the following in my environment, I see the mark in column 80.
goneovim -u NONE -c "if &co > 80 | set colorcolumn=80 | endif"
Could you please provide me with the following additional information?
~/.config/nvim/init.vim
that you are adding the following settings to?
Or do you set it in ginit.vim
or lua setting file? Note that, ginit.vim
is currently not loaded by goneovim.
if &co > 80
set colorcolumn=80
endif
Hi, I am using Linux Mint 20.3, I load all my configs from ~/.config/nvim/init.vim. I ran the above command with and without --maximized option
goneovim --maximized -u NONE -c "if &co > 80 | set colorcolumn=80 | endif"
However I still don't see the colorcolumn, so I believe this is something specific to the distribution or the binary.
I use neovim 0.5.1, however, when I ran goneovim and checked the version using :version, I found that it is using 0.4.3 binary somehow. I tried passing the --nvim flag to the binary but I get the following error:
msgpack/rpc: session closed
Ah, okay, I have neovim installed from Ubuntu as well as the latest one in the $PATH. I removed the older version and now I have smooth scrolling working.
However, the colorcolumn issue is still present. I always have to set it manually through :set colorcolumn=80 in the buffer. Using the -u NONE -c "..." command doesn't work either.
Is there something I could help you to debug this with? I am not sure how Linux environment can affect this. As far as I can understand, the &co variable returns 169 when the neovim is opened through terminal. goneovim returns 134 however the colorcolumn variable is not set.
I use another plugin called tagbar and it's size is dynamically loaded through the column size (1/3rd of the total value). Even that is working incorrectly, so we can deduce that somewhere during the initialization the init.vim is being called early maybe?
@daedroza Okay. I usually use MacOS, so I will proceed to investigate the problem on my Linux machine. I'm going to bed today, so further updates will be tomorrow at the earliest, but I'll let you know if there are any updates :)
@daedroza Hmm, I tried it on a Linux machine and it doesn't seem to be causing any problems. Am I misunderstanding the problem in some fundamental way?
https://user-images.githubusercontent.com/8478977/144243018-055dbbd7-600c-4f40-bf52-5a2c80977782.mp4
Weird that it works for you. I tried this on Fedora 35 as well, same issue. No idea what's wrong, but I think I will have to stick with terminal variant :(
@daedroza
If we take the facts straight, I think it means that when the colorcolumn setting is loaded, the condition is not met. Since goneovim is affected by OS-level settings, WM, etc. in order to create an independent application window, such factors may be making the initially created window size smaller, and the number of columns smaller.
For example, the following may be useful in isolating the problem.
goneovim --maximized -u NONE -c "if &co > 10 | set colorcolumn=10 | endif"
goneovim --maximized -u NONE -c "set colorcolumn=80"
I tried the following command:
goneovim --maximized -u NONE -c "if &co > 10 | set colorcolumn=10 | endif"
Indeed it clearly works. However that clearly shows that loading of vim scripts should be moved to the end, after the window size is loaded and initialized. Because after the instance is fully loaded, the column size is different that the one while loading the vim scripts indicating that it should be treated as a bug.
@daedroza
Your point is correct, but in current implementation, goneovim set the window size and then tell nvim the number of rows and columns. The same goes for the maximize option. In fact, it works correctly on my macOS and linux machines.
I'm wondering if there is a setting specific to your machine, but at this point I have no idea.
As an ongoing point of investigation, I'd like to know if you explicitly specify width and height in settings.toml, what will happen?
Explicitly doing so works! Awesome. But using the --maximized doesn't work at all. Now I have to figure how the optimal value for setting height and width can be set as a workaround. Glad we made some progress!
One more question. Is it possible to load bash variables using source? I am setting FZF_DEFAULT_COMMAND and RIPGREP_CONFIG_PATH which is not passed to the instance unless I fire it through terminal.
Perhaps the window resizing by --maximized
is occurring asynchronously, in parallel with the execution process of nvim. Since this window sizing process is abstracted in the Qt layer, there may be some differences in behavior depending on the OS.
goneovim reads the environment variables defined in the shell defined by the environment variable $SHELL
at startup. The following examples of past issues may be helpful.
https://github.com/akiyosi/goneovim/issues/164
Closing as there is a workaround available. However, would be preferred if it could be fixed.
Thanks for your time and project!
I have set colorcolumn if there more than 80 columns present, however, it doesn't work at all. I have to manually set the colorcolumn inside the geneovim instance. Is there a way to to mitigate this?
I have also tried running the goneovim instance maximized on start, however, it still doesn't work.
The reason I require this is because I have set few buffer size like for tagbar to be set according to the number of columns present, for example, if there are 100 columns, I set the tagbar size to 1/3 of that size.