You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It doesn't quite do the feature justice as it doesn't cover what happens when you surround code blocks. For instance, if you have this:
if (symbol_file)
{
ObjectFile *object_file = symbol_file->GetObjectFile();
object_file->Dump();
}
And you want to turn that into:
if (foobar)
{
if (symbol_file)
{
ObjectFile *object_file = symbol_file->GetObjectFile();
object_file->Dump();
}
}
You would position your caret above the if (symbol_file) line, type if, hit some key to trigger the auto surround, click the down arrow once to move the bottom brace to below everything, and you'd be done.
Right now in Sublime, I'm typing if {, deleting the extra lines and }, selecting the text, shifting the text over, then going to the bottom of the text and adding the closing brace.
This is a feature request thing. In Slickedit, there is a super useful thing called dynamic surround. There is a video here:
http://blog.slickedit.com/2012/09/syntax-expansion-dynamic-surround-and-surround-with-aliases/
It doesn't quite do the feature justice as it doesn't cover what happens when you surround code blocks. For instance, if you have this:
if (symbol_file)
{
ObjectFile *object_file = symbol_file->GetObjectFile();
object_file->Dump();
}
And you want to turn that into:
if (foobar)
{
if (symbol_file)
{
ObjectFile *object_file = symbol_file->GetObjectFile();
object_file->Dump();
}
}
You would position your caret above the if (symbol_file) line, type if, hit some key to trigger the auto surround, click the down arrow once to move the bottom brace to below everything, and you'd be done.
Right now in Sublime, I'm typing if {, deleting the extra lines and }, selecting the text, shifting the text over, then going to the bottom of the text and adding the closing brace.
One simple possibility would be to fix sublime-surround ( https://github.com/jcartledge/sublime-surround ) to auto-indent the block instead of just slapping braces around the text.
The text was updated successfully, but these errors were encountered: