wadetb / Sublime-Text-Advanced-CSV

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

Disable CSV commands when syntax is not CSV #9

Closed aziz closed 9 years ago

aziz commented 9 years ago

Try to implement is_enabled(<args>) and is_visible(<args>) is your commands

wadetb commented 9 years ago

Thanks for the suggestion, I'll look into implementing these.

wadetb commented 9 years ago

Thinking about this some more, I'd like to extend the ability of the plugin to operate on tables in non-CSV files. For example I'd like to be able to use the expression evaluation and column lineup features in tables or CSV data embedded in Markdown files.

wadetb commented 9 years ago

So if I wrote these callbacks they would have to do some heuristic matching, like "is there more than one column parseable from the text the cursor is in", as opposed to just "is this a .csv file".

aziz commented 9 years ago

I understand. It kinda make sense to me a well. I'm gonna close this issue.

wadetb commented 9 years ago

Thanks! I'll revisit if I develop this heuristic ability further in the future.

nicksspirit commented 5 years ago

Have you been able to figure out the heuristic?

I think think that the best thing to do is to only enable the commands when the file is either csv or markdown. This way, we won't clutter the sub menu with commands that don't make sense in a specific context.