ecomba / vim-ruby-refactoring

Refactoring tool for Ruby in vim!
520 stars 52 forks source link

Convert Post-Conditional #13

Closed bishboria closed 13 years ago

bishboria commented 13 years ago

Hi Enrique, added a simple function that converts post-conditional expressions into conditional expressions. E.g.

do something if condition

becomes

if condition do something end

Also works for unless, while and until. The condition can also be in parentheses.

bishboria commented 13 years ago

Updated: previously the function would keep searching backwards until it found a conditional operator. It now stops if a conditional isn't found on the current line.

ecomba commented 13 years ago

Thanks a lot mate! :) Looks good!