Sublime Forum

Expand Selection to Block

#1

Hi!

I’m having a hard time to select exactly what I need with just a shortcut. There’s the new ‘Expand Selection to Indentation’ that is really cool but I think one is needed to also stop at paragraphs.

Here’s what I mean:

if (move_uploaded_file($_FILES'userfile']'tmp_name'], $uploadfile))
      {
        $user_doc = new UserDoc();
        $user_doc->user_id = $this->getUser()->getGuardUser()->getId();
        $user_doc->filename = $filename;
        $user_doc->flag = 'PHOTO';
        $user_doc->is_validated = 1;
        $user_doc->save();
 
        $this->getContext()->getConfiguration()->loadHelpers('Partial');
        return $this->renderText(get_partial('user/photo_with_delete', array('photo' => $user_doc)));
      }

On the $user_doc block:

Expand Selection to Paragraph will select the $user_doc block BUT also the if(…)
Expand Selection to Indentation will select the $user_doc UNTIL the end of the return
Expand Selection to Block would select just the $user_doc block, so using the indentation + the paragraph features

What do you think? I think it can be really useful :smile:

0 Likes

#2

At the same level and under, like the current indentation is working. And yes, only the contiguous lines.

That means that in that case:

[code] public static function getUserSectionsList($user_id)
{
$q = Doctrine_Query::create()
->from(‘ModuleSectionUser’)
->where(‘user_id = ?’ , array($user_id));

return $q->execute();

}[/code]

If I’m on the ‘Doctrine_Query’ line, it goes from ‘$q’ to ‘$user_id));’.
If I’m on the ‘->from(’, I need to use the shortcut twice to select the block, exactly like the current indentation implementation.

Hope it makes sense.

0 Likes