Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Surround #3

Open
mikesartain opened this issue Jun 11, 2013 · 0 comments
Open

Dynamic Surround #3

mikesartain opened this issue Jun 11, 2013 · 0 comments
Assignees

Comments

@mikesartain
Copy link

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.

@ghost ghost assigned typopl Jun 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants