]> git.pld-linux.org Git - packages/vim.git/blob - 7.3.014
- new
[packages/vim.git] / 7.3.014
1 To: vim-dev@vim.org
2 Subject: Patch 7.3.014
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 7.3.014
11 Problem:    Ending a line in a backslash inside an ":append" or ":insert" 
12             command in Ex mode doesn't work properly. (Ray Frush)
13 Solution:   Halve the number of backslashes, only insert a NUL after an odd 
14             number of backslashes.
15 Files:      src/ex_getln.c
16
17
18 *** ../vim-7.3.013/src/ex_getln.c       2010-09-21 16:56:29.000000000 +0200
19 --- src/ex_getln.c      2010-09-29 15:47:56.000000000 +0200
20 ***************
21 *** 2342,2356 ****
22         windgoto(msg_row, msg_col);
23         pend = (char_u *)(line_ga.ga_data) + line_ga.ga_len;
24   
25 !       /* we are done when a NL is entered, but not when it comes after a
26 !        * backslash */
27 !       if (line_ga.ga_len > 0 && pend[-1] == '\n'
28 !               && (line_ga.ga_len <= 1 || pend[-2] != '\\'))
29 !       {
30 !           --line_ga.ga_len;
31 !           --pend;
32 !           *pend = NUL;
33 !           break;
34         }
35       }
36   
37 --- 2342,2372 ----
38         windgoto(msg_row, msg_col);
39         pend = (char_u *)(line_ga.ga_data) + line_ga.ga_len;
40   
41 !       /* We are done when a NL is entered, but not when it comes after an
42 !        * odd number of backslashes, that results in a NUL. */
43 !       if (line_ga.ga_len > 0 && pend[-1] == '\n')
44 !       {
45 !           int bcount = 0;
46
47 !           while (line_ga.ga_len - 2 >= bcount && pend[-2 - bcount] == '\\')
48 !               ++bcount;
49
50 !           if (bcount > 0)
51 !           {
52 !               /* Halve the number of backslashes: "\NL" -> "NUL", "\\NL" ->
53 !                * "\NL", etc. */
54 !               line_ga.ga_len -= (bcount + 1) / 2;
55 !               pend -= (bcount + 1) / 2;
56 !               pend[-1] = '\n';
57 !           }
58
59 !           if ((bcount & 1) == 0)
60 !           {
61 !               --line_ga.ga_len;
62 !               --pend;
63 !               *pend = NUL;
64 !               break;
65 !           }
66         }
67       }
68   
69 *** ../vim-7.3.013/src/version.c        2010-09-29 13:02:48.000000000 +0200
70 --- src/version.c       2010-09-29 15:45:57.000000000 +0200
71 ***************
72 *** 716,717 ****
73 --- 716,719 ----
74   {   /* Add new patch number below this line */
75 + /**/
76 +     14,
77   /**/
78
79 -- 
80 hundred-and-one symptoms of being an internet addict:
81 224. You set up your own Web page. You set up a Web page for each
82      of your kids... and your pets.
83
84  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
85 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
86 \\\        download, build and distribute -- http://www.A-A-P.org        ///
87  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.04419 seconds and 3 git commands to generate.