Add expand selection #132

mkleehammer opened this Issue Nov 7, 2013 · 3 comments


None yet
2 participants

Great plugin, which I just found so these features might be present somehow.

I commonly want to move a div and all of its contents but don't see an easy way to select it. I can select the contents, but it doesn't pick up the div itself.

While another command to include the tags would be nice, adding an "expand selection" command would accomplish the same thing and add more functionality.

If there is no selection, it would highlight the innermost tags. Since I need the tags highlighted, I would prefer if included them immediately, but I could see starting with the contents and having the next expand grow to include the tags. This sounds complicated though.

Once there is a selection, each invocation would expand outward.

I think this could replace "select tag contents" for most people.

Thanks for the great plugin.


facelessuser commented Nov 7, 2013

Since I now let people bind their own keys, I can add an option to select entire tag (content and tag), and then people can choose to use what they like.

Expand selection works with most other brackets, but tags are kind of done special, so expand selection doesn't really work for them. Tags require you to be in a tag, while most other brackets locate the bracket when you are between them. I would have to think how I wish to do that and if it is possible with the current framework.

It all gets complicated, you can take a look at the code and see what I mean. It gets very complicated to allow people to have all these custom brackets with a common core that uses regex. HTML is hard enough to target with regex by itself.


facelessuser commented Jan 20, 2014

@mkleehammer I added a flag for the bracket select command to always select the tags with content. So by just taking the current command and adding the always_include_brackets argument, you can select the content and tags:

    // Select text including brackets
        "keys": ["ctrl+alt+super+d"],
        "command": "bh_key",
            "lines" : true,
                "type": ["__all__"],
                "command": "bh_modules.bracketselect",
                "args": {"always_include_brackets": true}

facelessuser commented Jan 20, 2014

I am going to consider this issue closed. Report back if you find issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment