Comment #1 on issue 102 by [email protected]: Cursor at incorrect location after doing substitution %s/x/y/c when file contains folds
http://code.google.com/p/vim/issues/detail?id=102

Christian Brabandt wrote:

Here is a patch:
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -5200,6 +5200,7 @@
             EMSG2(_(e_patnotf2), get_search_pat());
      }

+    changed_window_setting();
      vim_free(regmatch.regprog);
  }


regards,
Christian


Thanks Christian.

I confirm that your patch works.

To avoid useless redraws in most cases, I suppose that we can
update the window if and only if the substitution confirmation
flag was set (:%s/.../.../c) and there are folds.

So how about this?

diff -r b89e2bdcc6e5 src/ex_cmds.c
--- a/src/ex_cmds.c     Sun Dec 16 12:50:40 2012 +0100
+++ b/src/ex_cmds.c     Sat Jan 12 10:25:48 2013 +0100
@@ -5200,6 +5200,10 @@
            EMSG2(_(e_patnotf2), get_search_pat());
     }

+#ifdef FEAT_FOLDING
+    if (do_ask && hasAnyFolding(curwin))
+       changed_window_setting();
+#endif
     vim_free(regmatch.regprog);
 }

Regards
Dominique

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui