Comments (4)
Hi, this looks strange, I tested your file and autodetection worked for me as expected.
BTW, you can try to set vim.g.rcsv_delimiters = [";", ","]
it should be an array, not a dictionary.
Maybe you can also try to update rainbow_csv if you are using not the latest version.
Also, autodetection doesn't work if the number of lines is less than 5, but in the case of your file, it should be fine since it has exactly 5 lines.
from rainbow_csv.
Thanks for quick reply.
Sorry i forgot to mention that i configure global variables and most other things in lua, which is why the assignment looks strange (everything is a "table" in lua). Running :echo g:rcsv_delimiters returns [';', ',']. I tried with your specific suggestion and still same result on the test file and larger "real" ones. I also tried with a minimal config that only imports your plugin and sets the global but no luck.
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:
https://github.com/neovim/neovim/releases/tag/stable
If you are on linux you can simply download and execute the appimage.
This is the init.vim config i used:
" auto-install vim-plug
if empty(glob('~/.config/nvim/autoload/plug.vim'))
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall | source $MYVIMRC
endif
" Plug
call plug#begin('~/.vim/plugged')
Plug 'mechatroner/rainbow_csv'
call plug#end()
lua << EOF
vim.g.mapleader = " "
vim.opt.termguicolors = false
vim.g.rcsv_delimiters = {";", ","}
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.
from rainbow_csv.
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.
The extension caches autodetection results in `~/.rbql_table_index' text file so you can also try to clean/remove the file or see if it contains suspicious entries and remove them.
from rainbow_csv.
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:
/home/joakim/ksjgsg.csv ; quoted @auto_comment_prefix@
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:
func! rainbow_csv#handle_syntax_change()
let [delim, policy, comment_prefix] = rainbow_csv#get_current_dialect()
echoerr 'delim:' .. delim
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.
from rainbow_csv.
Related Issues (20)
- duplicate colors? HOT 2
- Failed to load Python host. HOT 3
- warning on comment lines are not ignored HOT 1
- modeline disables colors
- [bug] change colorscheme will make color disappear HOT 2
- [feature] Allow user customize hotkey
- rcsv_colorpairs hex
- Space leader key hijacked with rainbow key mappings disabled
- CSV tables that contain cells with newlines are not rendered properly HOT 4
- Image hosting issue HOT 2
- [bug] Error when source a non-exist syntax HOT 2
- How to keep the autodetection function and only apply to .csv and .tsv files? HOT 1
- Tips for dealing with inconsistent number of columns HOT 2
- g:rainbow_comment_prefix Not Honored HOT 1
- Multiline tabbed CSVs do not work.
- rainbow color HOT 1
- Searching with Nn: Status line is overwritten with column name, can't see search results HOT 1
- Don't modify laststatus HOT 4
- Alignment Issues in Nvim HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rainbow_csv.