I’ve been wanting this feature for awhile, and actually think it should be standard. For those of you wanting your selection to reindent itself when moving it up and down through your code, just add this line to the end of SwapLineUpCommand#run and SwapLineDownCommand#run in Packages/Default/swap_line.py:
self.view.run_command("reindent")
Pretty simple. Now when swapping lines around you get this:
if (true) {
}
return true;
swap “return true;” line up
if (true) {
return true; <-- note the indentation
}
instead of the default behavior:
if (true) {
}
return true;
swap “return true;” line up
if (true) {
return true; <-- note the indentation
}