Sublime Forum

How to get the status of case_sensitive and whole_word in Find panel?



In the Find panel, there are several icons to tell whether case_sensitive and whole_word are on or off during the finding process.

These statuses are important, because they also have an impact on the find_under_expand and other commands.

I know that there are commands such as toggle_case_sensitive and toggle_whole_word that may toggle these statuses.

But is there any way, in plugin development, to get the status of case_sensitive and whole_word in the Find panel?



It is possible I believe to get the state of the Regular Expression option since the find input widget uses a different syntax for it (source.regexp instead of text.plain) (as long as the input focus is in the find widget) but for others, I don’t think as of today there is a way to get their states. There is an open issue on the issue tracker about this.



Thank you @UltraInstinct05 for the answer and the link!

Then this sounds disappointing, because it is really inconvenient, not just for plugin development, but also for a normal user.

I believe many users like me constantly need to alternate between on and off for the whole word mode when doing find_under_expand. Currently I could only pop up the Find panel, take a look at the button to see whether whole word mode is on or off, then do the find_under_expand. (Or by trial and error.)

If this status could be retrieved somewhere, then it would be very easy for me to write a few lines of Python code to display the whole word mode at the status bar.



You can always give a thumb’s up to the issue and additionally describe of what use you would put if such a functionality were to be implemented so that it would help the dev’s prioritize it better for future releases.