From 7961fd6faeb31232e4d74e76d86bb4cb68de3ec2 Mon Sep 17 00:00:00 2001 From: Ingo Karkat Date: Tue, 16 Feb 2016 17:22:01 +0100 Subject: [PATCH] Temporarily disable folding when swapping Especially with XML/HTML tag swapping (e.g.

->

), the process of swapping may affect folding, and a suddenly closed fold may mess with the location of the second swap location. --- plugin/swapit.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin/swapit.vim b/plugin/swapit.vim index 5dccae2..5b83ac0 100755 --- a/plugin/swapit.vim +++ b/plugin/swapit.vim @@ -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 " . next_word "\. ' ' . word_index . ' ' . a:direction . ' ' . len(word_options) endtry