facelessuser / BracketHighlighter

Bracket and tag highlighter for Sublime Text
https://facelessuser.github.io/BracketHighlighter/
1.74k stars 245 forks source link

Settings in docs stop default `expand selection` working correctly #582

Closed benfrain closed 3 years ago

benfrain commented 3 years ago

Description

The settings described here https://facelessuser.github.io/BracketHighlighter/usage/

        "match_brackets": false,
    "match_brackets_angle": false,
    "match_brackets_braces": false,
    "match_brackets_content": false,
    "match_brackets_square": false,
    "match_tags": false,

seem to stop the default 'expand selection' to work correctly.

Here was the issue I was having: https://github.com/sublimehq/sublime_text/issues/4093

Support Info

Steps to Reproduce Issue

  1. Ensure settings described in docs are present in Preferences
  2. Select inside a CSS rule and use 'expand selection' command
  3. Note that expansion is not as it should be
facelessuser commented 3 years ago

You can enable ST native bracket highlighting if you like. Yes, it seems to disable ST's bracket highlighting and also disables its ability to expand to brackets. Often, I'm using BH's expand to bracket features, but I understand that being a problem if you want to use the built in expand for selections to braces and such. I guess, as an alternative, you could potentially enable Sublime's default bracket highlighting, and style it in a way that hides them.

So my question is, what are you requesting I do?

benfrain commented 3 years ago

If the issue cannot be rectified so BracketHighlighter can play alongside those default editor expansion commands, I suppose the best option would be to add a warning in that section of the docs that disabling Sublimes matching will lead to problems with standard expansion commands.

I certainly think those settings lead to a worse user experience currently as it makes you think ST has a problem (there was some time between enabling those settings with BH and trying 'expand selection' and so I didn't make the connection).

The styling option seems worth investigating. Maybe add the warning in the docs for now, and remove it if you find a workaround?

facelessuser commented 3 years ago

The thing I don't understand is why turning off Sublime bracket matching disables bracket expansion. Just because I may not want to see Sublime's bracket matching, it doesn't mean I want to disable all bracket features. I'd still argue this to be undesirable in Sublime.

facelessuser commented 3 years ago

I was looking at this today, and maybe a better recommendation moving forward is to override the two color scheme variables:

        "bracket_contents_options": "none",
        "brackets_options": "none",

Here we can hide the visualization so it doesn't clash with BH without disabling bracket abilities in Sublime.

facelessuser commented 3 years ago

These as well:

    "tags_options": "none"
facelessuser commented 3 years ago

I've updated the documentation to reflect the new recommendation. I'm open to alternative suggestions, but I think the new recommendation is the best that can be done. I'll update the documentation site later today.

benfrain commented 3 years ago

Thanks @facelessuser I look forward to enabling it again. Already miss selection inside quotes! 👍🏻

benfrain commented 3 years ago

@facelessuser prior to doc updates, can you confirm, is the following now all the options that need setting?:

"bracket_contents_options": "none",
"brackets_options": "none",
"tags_options": "none",
facelessuser commented 3 years ago
{
    "variables": {},
    "globals":
    {
        "bracket_contents_options": "none",
        "brackets_options": "none",
        "tags_options": "none"
    },
    "rules": []
}

That's in my current override. If you have additional issues, let me know, but as far as I can tell, that is sufficient.