Sublime Forum

Expand Selection to (curly) brackets?

#1

Hi there!

Not sure whether it’s a bug or a feature, but I can’t make a selection the way I want now in ST2.

To give an example, here’s my code:

[code]
/**

  • getUserSectionsList(user_id)
  • @return list of sections for the user given in parameter in doctrine objects
  • @author
    **/
    public static function getUserSectionsList($user_id)
    {
    return Doctrine_Query::create()
    ->from(‘ModuleSectionUser’)
    ->where(‘user_id = ?’ , array($user_id))
    ->execute();
    }[/code]

When I’m in the body of my function, I’d like to use a shortcut to select from ‘return’ to ‘execute();’ (to put those lines in comments in that case). I’ve tried using the Expand to Scope, Brackets and Paragraph but it never really does the work. Brackets should be the closest, but it includes the two curly brackets (where I think it shouldn’t, at least at the first selection).

Anything I am missing? :smile:

1 Like

#2

There’s a new Expand Selection to Indentation command in the current dev build that will do what you want if you’re on the line that says “return Doctrine_Query::create()”. Other than that I don’t know.

0 Likes

#3

Hi!
Thanks for the answer. It works well in this particular case, but not if there are several paragraphs in the body of the function. Select by indentation works ALMOST fine, Select by paragraph also. Actually what is needed is a Selection that is a combination of the 2.

0 Likes