-
Notifications
You must be signed in to change notification settings - Fork 22
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
Should delimiter autodetect work in Neovim 0.8.1? #41
Comments
Hi, this looks strange, I tested your file and autodetection worked for me as expected. |
Thanks for quick reply. Also using latest version of the plugin. Do you think you could make a quick check using latest stable neovim? Should be very easy to install from here: This is the init.vim config i used: " auto-install vim-plug autocmd VimEnter * PlugInstall | source $MYVIMRC " Plug call plug#end() lua << EOF Alternatively it would be nice to have an explanation on how the autodetect works. To my eyes it looks like it does some kind of caching not to keep setting the type for the same file over and over. If my cache is somehow acting up it would be nice to know how it works. |
Thanks, I might try to reproduce this when I have more time. If you want you can also try to debug this further by using "echo"/"echom"/"messages" commands inside the autodetection call stack. |
I removed the rbql_table_index and found that its contents are set correctly for my file if i do it manually via RainbowDelim. What is very interesting is that even if the only file contents are as follows: The delimiter loading fails when i open the file. Even more interesting is that it DOES load correctly if i e.g. add this echoerr to the following location:
Then it prints the correct delimiter ";", stops executing certain code and highlighting works as expected. Looks to me like there is some code that resets the delimiter or makes the highlighting fail. |
Syntax autodetection for semicolons and Rainbow features seem work if I comment out this line: rainbow_csv/autoload/rainbow_csv.vim Line 1881 in 3dbbfd7
|
Does it break something else? You would think that line is there for a reason. I can try to look into this when i have some time again. Very busy at work atm. |
I deal with a balanced mix of files with , and ; delimiters and for some reason i've never been able to autodetect semicolons. If i forcibly set every csv file to csv_semicolon it works but it is as if i can't get the autodetect to run at all.
First i played around with various configs to see if they would change anything but e.g these did nothing:
vim.g.disable_rainbow_csv_autodetect = 0
vim.g.rbql_with_headers = 1
vim.g.rcsv_delimiters = {";"}
vim.g.rbql_use_system_python = 1
Despite zero vimscript knowledge, i even tried debugging the code with error messages. From what i can tell it seems that no autodetect code is ever run on file open. It always stops doing anything when it finds that "rainbow_features_enabled" is on and just always set the file type to "csv" with this:
execute "set ft=" . ft_power_cycle
Am i just dumb or why is it not able to detect that e.g this is a semicolon file?:
date;amount;other_party;category;account;recipient;bank;description
2018-05-31;148.35;p;data;a;b;;data
2018-05-31;415;p;data;a;b;;data
2018-05-31;-2.6;p;data;a;b;;data
2018-06-01;-2.6;p;data;a;b;;data
Manually setting it works fine but not auto. Is there a config i'm missing?
The text was updated successfully, but these errors were encountered: