sublime_rainbow_csv icon indicating copy to clipboard operation
sublime_rainbow_csv copied to clipboard

Spell-check and quote logic.

Open shkiss opened this issue 6 years ago • 2 comments

(These effects were discovered using tab delimited notes, a useful but probably unintended use-case. The problems however persist to comma separated content.)

  • The second column does not receive spell-check, other columns do.
    • spell-chicked,not spell-chicked,spell-chicked
  • Text before or after quoted contents has strange results
    • These are invalid, but I think they should be treated as the same column.
    • "a,b"c
    • d"a,b"

shkiss avatar Mar 22 '18 04:03 shkiss

I think the reason why spell check doesn't work for column 2 is because the second column has "keyword.rainbow2" scope, and "keyword" scopes are not checked by spell-checker by default. this can be changed by modifying "spelling_selector" config variable, although I haven't tried to do it. Also I will consider renaming "keyword.rainbow2" to "function.rainbow2" or some other scope name that allows default spell-checking.

Speaking about bug with incorrect highlighting of invalid records, I didn't expect that it could look so bad and that color change could occur even at non-comma character. Actually there is a way to highlight invalid part of any record with a special "invalid" color (and it is implemented in Atom version), but for some reason this improved grammar doesn't work well with Sublime regex engine: https://github.com/SublimeTextIssues/Core/issues/2188 I will try to find a workaround at some point, and I will also implement CSVLint functionality to automatically validate CSV files, this should make the problem less severe.

mechatroner avatar Mar 24 '18 03:03 mechatroner

Thank you. Your proposed "spelling_selector" workaround works. I would rather have spell-check on something I don't want than not have it on something I do!

shkiss avatar Mar 25 '18 02:03 shkiss