Skip to content

Commit

Permalink
Merge pull request #25 from inkarkat/fix-nofoldenable
Browse files Browse the repository at this point in the history
Temporarily disable folding when swapping
  • Loading branch information
mjbrownie committed Feb 17, 2016
2 parents 7a1aea8 + 7961fd6 commit 822e737
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugin/swapit.vim
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ fun! SwapMatch(swap_list, cur_word, count, direction, is_visual)
return 0
endif

let save_foldenable = &l:foldenable
setlocal nofoldenable

exec 'norm! T<m' . temp_mark
norm %
let on_start_tag = 1
Expand Down Expand Up @@ -356,6 +359,7 @@ fun! SwapMatch(swap_list, cur_word, count, direction, is_visual)
finally
call setreg('"', save_reg, save_regmode)
let &clipboard = save_clipboard
if exists('save_foldenable') | let &l:foldenable = save_foldenable | endif
" echo "Swap: " . a:swap_list['name'] .' '. a:cur_word . " > " . next_word
"\. ' ' . word_index . ' ' . a:direction . ' ' . len(word_options)
endtry
Expand Down

0 comments on commit 822e737

Please sign in to comment.