073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.261
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.261
073263
Problem:    When updating the window involves a regexp pattern, an interactive
073263
	    substitute to replace a "\n" with a line break fails. (Ingo
073263
	    Karkat)
073263
Solution:   Set reg_line_lbr in vim_regsub() and vim_regsub_multi().
073263
Files:	    src/regexp.c, src/testdir/test79.in, src/testdir/test79.ok
073263
073263
073263
*** ../vim-7.4.260/src/regexp.c	2014-04-06 21:33:39.671363743 +0200
073263
--- src/regexp.c	2014-04-23 18:40:37.094866280 +0200
073263
***************
073263
*** 7381,7386 ****
073263
--- 7381,7387 ----
073263
      reg_mmatch = NULL;
073263
      reg_maxline = 0;
073263
      reg_buf = curbuf;
073263
+     reg_line_lbr = TRUE;
073263
      return vim_regsub_both(source, dest, copy, magic, backslash);
073263
  }
073263
  #endif
073263
***************
073263
*** 7400,7405 ****
073263
--- 7401,7407 ----
073263
      reg_buf = curbuf;		/* always works on the current buffer! */
073263
      reg_firstlnum = lnum;
073263
      reg_maxline = curbuf->b_ml.ml_line_count - lnum;
073263
+     reg_line_lbr = FALSE;
073263
      return vim_regsub_both(source, dest, copy, magic, backslash);
073263
  }
073263
  
073263
*** ../vim-7.4.260/src/testdir/test79.in	2014-04-02 19:00:53.043644100 +0200
073263
--- src/testdir/test79.in	2014-04-23 18:36:29.158872254 +0200
073263
***************
073263
*** 1,6 ****
073263
--- 1,7 ----
073263
  Test for *sub-replace-special* and *sub-replace-expression* on :substitute.
073263
  Test for submatch() on :substitue.
073263
  Test for *:s%* on :substitute.
073263
+ Test for :s replacing \n with  line break.
073263
  
073263
  STARTTEST
073263
  :so small.vim
073263
***************
073263
*** 234,239 ****
073263
--- 235,254 ----
073263
  Q
073263
  
073263
  STARTTEST
073263
+ :function! TitleString()
073263
+   let check = 'foo' =~ 'bar'
073263
+   return ""
073263
+ endfunction
073263
+ :set titlestring=%{TitleString()}
073263
+ :/^test_one/s/.*/\="foo\nbar"/
073263
+ :/^test_two/s/.*/\="foo\nbar"/c
073263
+ y
073263
+ ENDTEST
073263
+ 
073263
+ test_one
073263
+ test_two
073263
+ 
073263
+ STARTTEST
073263
  :g/^STARTTEST/.,/^ENDTEST/d
073263
  :1;/^Results/,$wq! test.out
073263
  :call getchar()
073263
*** ../vim-7.4.260/src/testdir/test79.ok	2014-04-02 19:00:53.043644100 +0200
073263
--- src/testdir/test79.ok	2014-04-23 18:35:30.650873664 +0200
073263
***************
073263
*** 126,128 ****
073263
--- 126,134 ----
073263
  Q
073263
  Q
073263
  
073263
+ 
073263
+ foo
073263
+ bar
073263
+ foo
073263
+ bar
073263
+ 
073263
*** ../vim-7.4.260/src/version.c	2014-04-23 17:43:37.366948683 +0200
073263
--- src/version.c	2014-04-23 18:46:45.250857408 +0200
073263
***************
073263
*** 736,737 ****
073263
--- 736,739 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     261,
073263
  /**/
073263
073263
-- 
073263
From "know your smileys":
073263
 !-|	I-am-a-Cylon-Centurian-with-one-red-eye-bouncing-back-and-forth
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///