Skip to content

Commit

Permalink
Do not re-indent in visual selections if chosen
Browse files Browse the repository at this point in the history
If g:move_auto_indent is set to 0 we are not allowed to re-indent. This can
prevent problems like #9.
  • Loading branch information
matze committed Mar 18, 2014
1 parent 98ce670 commit 4e2680c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions plugin/move.vim
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ function! s:MoveBlockDown(start, end, count)
endif

execute "silent" a:start "," a:end "m " next_line
call s:ResetCursor()
if (g:move_auto_indent == 1)
call s:ResetCursor()
else
normal! gv
endif
endfunction

function! s:MoveBlockUp(start, end, count)
Expand All @@ -55,7 +59,11 @@ function! s:MoveBlockUp(start, end, count)
endif

execute "silent" a:start "," a:end "m " prev_line
call s:ResetCursor()
if (g:move_auto_indent == 1)
call s:ResetCursor()
else
normal! gv
endif
endfunction

function! s:MoveLineUp(count) range
Expand Down

0 comments on commit 4e2680c

Please sign in to comment.