Coder Social home page Coder Social logo

Comments (12)

mechatroner avatar mechatroner commented on May 30, 2024 2

So, I've published version 1.0.0 which enables Preferences -> Package Settings for rainbow csv. It also includes some other minor changes that I mentioned here, see release notes.

from sublime_rainbow_csv.

dmi7ry avatar dmi7ry commented on May 30, 2024

Same problem. How can I disable autodetect? (where can I set "enable_rainbow_csv_autodetect": false?)

from sublime_rainbow_csv.

mechatroner avatar mechatroner commented on May 30, 2024

Sorry about late reply, guys.

For now you can add this setting by clicking "Preferences"->"Settings"
and then add the following line into the right (User) file: "enable_rainbow_csv_autodetect": false (don't forget to add a comma for the previous lines if you have it).

Actually I just found out that many other sublime plugins implement custom plugin settings available through Preferences -> Package Settings. I will also implement such configuration feature for rainbow csv, but it may take some time.

from sublime_rainbow_csv.

dmi7ry avatar dmi7ry commented on May 30, 2024

For now you can add this setting by clicking "Preferences"->"Settings"
and then add the following line into the right (User) file: "enable_rainbow_csv_autodetect": false (don't forget to add a comma for the previous lines if you have it).

I tried it and it doesn't work for me. I always thought that plugin settings are independent of the settings of Sublime itself (just a guess, I don’t know for sure). It is possible that because of this, the autodetection disable does not work for me.

Actually I just found out that many other sublime plugins implement custom plugin settings available through Preferences -> Package Settings. I will also implement such configuration feature for rainbow csv, but it may take some time.

Thank you. Looking forward to it.
And thank you for this userful plugin.

from sublime_rainbow_csv.

mechatroner avatar mechatroner commented on May 30, 2024

Well, this parameter has very non-intuitive behavior (I will update the documentation in the new version to describe it better), but here how it actually works: If Rainbow CSV had seen a file once and decided to highlight it, it will always be highlighted (no matter what the value of "enable_rainbow_csv_autodetect" is) until you manually disable highlighting for that file. So the setting will work for new files, but not for old ones. Also it will not affect files with ".tsv" and ".csv" extensions - these would always be highlighted anyway. So maybe you've just tried the settings with files that you've already opened before and therefore got an impression that setting doesn't work, while it actually does. Could you please try to rename a file (just don't use ".csv" or ".tsv" extension) and open it again with Sublime - it shouldn't be higlighted this time.

BTW, @dmi7ry , can I ask you, why do you want to disable autodetection mechanism?

from sublime_rainbow_csv.

dmi7ry avatar dmi7ry commented on May 30, 2024

I see. Indeed, it works for new files. How can I erase information about previously opened files?

Could you please try to rename a file (just don't use ".csv" or ".tsv" extension) and open it again with Sublime - it shouldn't be higlighted this time.

My files has .log extension. And yes, I opened these files before.

The reason is very simple. It wrongly detects some files and then opens them very slow (10 seconds instead of instantly, 40 seconds instead of a second, etc)(on i9-9900K)

from sublime_rainbow_csv.

mechatroner avatar mechatroner commented on May 30, 2024

To disable highlighting for a file do this:
On opened and highlighed file -> Right Click -> Rainbow CSV -> Disable

Or you can manually edit ~/.rbql_table_index file - just delete wrong lines from it.

from sublime_rainbow_csv.

mechatroner avatar mechatroner commented on May 30, 2024

Thank you for describing your usecase, I will probably limit the size of autodetected files, looks like this is a common problem

from sublime_rainbow_csv.

mechatroner avatar mechatroner commented on May 30, 2024

BTW in the next version I will try to get rid of ~/.rbql_table_index file - storing settings in home folder is very poor design decision.

from sublime_rainbow_csv.

dmi7ry avatar dmi7ry commented on May 30, 2024

To disable highlighting for a file do this:
On opened and highlighed file -> Right Click -> Rainbow CSV -> Disable

Or you can manually edit ~/.rbql_table_index file - just delete wrong lines from it.

Thank you

Thank you for describing your usecase, I will probably limit the size of autodetected files, looks like this is a common problem

I think it's already skips large files. I can't say exact sizes, but just as an example on files I can check right now:
it autodetects and opens 6.1MB file about 8-9 seconds, autodetects and opens 3.4MB file about 4-5 seconds, doesn't detect 36MB file (so, Sublime opens it less than an one second).

from sublime_rainbow_csv.

luispfonseca avatar luispfonseca commented on May 30, 2024

Well, this parameter has very non-intuitive behavior (I will update the documentation in the new version to describe it better), but here how it actually works: If Rainbow CSV had seen a file once and decided to highlight it, it will always be highlighted (no matter what the value of "enable_rainbow_csv_autodetect" is) until you manually disable highlighting for that file. So the setting will work for new files, but not for old ones. Also it will not affect files with ".tsv" and ".csv" extensions - these would always be highlighted anyway. So maybe you've just tried the settings with files that you've already opened before and therefore got an impression that setting doesn't work, while it actually does. Could you please try to rename a file (just don't use ".csv" or ".tsv" extension) and open it again with Sublime - it shouldn't be higlighted this time.

BTW, @dmi7ry , can I ask you, why do you want to disable autodetection mechanism?

Same here. It's not that I want to disable the automatic highlighting; I just want it to be optional when the file is large. For large data files I have stored in csv, it makes opening sublime really slow and I just kill the process rather than wait for it to end.

I've tried including the rainbow_csv_max_file_size_bytes option in the sublime settings and it seems to work. Thank you!

from sublime_rainbow_csv.

mechatroner avatar mechatroner commented on May 30, 2024

You are welcome!
Please don't close the issue - I'll do it once I add the custom settings mechanism.

from sublime_rainbow_csv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.