wadetb / Sublime-Text-Advanced-CSV

Efficiently format, edit, arrange, and evaluate cells in CSV files
169 stars 14 forks source link

.PSV not working #45

Open aaaaapiche opened 7 years ago

aaaaapiche commented 7 years ago

Hi Guys -- I'm trying to use this with a pipe-delimited file, and it's not working. I've tried naming the file as .psv, and setting the syntax to Advanced CSV. If i find and replace "|" with "," everything works. Problem is the file i'm working with also contains non-delimiting commas, so i'd rather not use that workaround.

Any help would be appreciated -- i love the functionality this plugin offers.

wadetb commented 7 years ago

Hi there, I just did a quick test in ST3 and it seems fine. I created a new file, saved it as test.psv on my desktop, and typed in the following text:

name|favorite color|age
mary|blue|25
tom|green|37
alex|purple|7

The justify columns command worked properly on this text. Does it work for you if you following the same steps? Can you paste an example to the issue that doesn't format correctly for you? Thanks!

aaaaapiche commented 7 years ago

Thanks for the quick reply! I followed the same steps you describe above, and the formatting is not working as I expected. I tried a .csv for comparision, and it worked as expected. Also the syntax highlighting the .csv looks as expected while the .psv does not:

Test steps:

  1. copy the text you reference above, and set the syntax highlighting to "Advanced CSV"
  2. save as test.psv (and test.csv respectively).
  3. Justify (CTRL-comma, spacebar)

.csv image

.psv image

wadetb commented 6 years ago

Thanks for the steps, I was able to reproduce the behavior! Looking in the Output pane, I see:

Using delimiter: '|'.
reloading /C/Users/wbrainerd/Desktop/test.psv
Using delimiter: ','.

So it seems the delimiter is overridden after the reload. If I then right click in the document and use CSV: Set delimiter and enter a | character, then it works as expected.

One possibility is that the "," choice gets recorded into the per-view settings as an override.

BTW, about syntax highlighting, unfortunately the syntax file is not delimiter-aware and I'm actually not sure if it's possible to fix.