rainbow_csv icon indicating copy to clipboard operation
rainbow_csv copied to clipboard

Alignment Issues in Nvim

Open himanshu-39k opened this issue 2 years ago • 1 comments

Hi, I am facing a slight issue, would appreciate your thoughts on this. if say I've a CSV data which contains a index field which would mean header would have trailing comma in it. Take a look in the following example:

,first,second,third,fourth
1,the,why,you,align
2,the,why,you,align
3,the,why,you,align

1,2&3 is the index number of the data. Screenshot 2023-11-15 at 12 02 10 PM

Plugin is able to detect the correct order of colours when I'm not trying to align it. As we can see in the picture, it is colouring the index in the separate colour. But what happens when I try to align the data is:

first ,second ,third ,fourth 
    1 ,the    ,why   ,you    ,align 
    2 ,the    ,why   ,you    ,align 
    3 ,the    ,why   ,you    ,align 

It somehow align the index into first column and last column is orphan without any header for it. It kind of ignores the first comma of the header. VSCode rainbow plugin handles this properly. I hope I explained the issue rightfully. Do let me know if I missed anything. Will put in more detail if required. Thanks

himanshu-39k avatar Nov 15 '23 06:11 himanshu-39k

Thank you for the bug report. But I couldn't reproduce this either in Vim or in Neovim, using this data:

,first,second,third,fourth
1,the,why,you,align
2,the,why,you,align
3,the,why,you,align

But I don't completely understand what is the "index number of the data."? is it a part of csv file itself or is this some sort of Neovim feature that adds these numbers? is '4' in the last line an index number too? why is it aligned further to the left than the other index numbers? Could you please the original (non-aligned) content of your files if it differs from what I posted? Thanks!

mechatroner avatar Nov 19 '23 02:11 mechatroner