summaryrefslogtreecommitdiff
path: root/source/ap/vim/patches/7.3.020
blob: 7c6de549d1ad2f8188559e12426524631e7c50c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
To: vim-dev@vim.org
Subject: Patch 7.3.020
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.3.020
Problem:    Cursor position wrong when joining multiple lines and
	    'formatoptions' contains "a". (Moshe Kamensky)
Solution:   Adjust cursor position for skipped indent. (Carlo Teubner)
Files:	    src/ops.c, src/testdir/test68.in, src/testdir/test68.ok


*** ../vim-7.3.019/src/ops.c	2010-08-15 21:57:28.000000000 +0200
--- src/ops.c	2010-10-09 17:00:35.000000000 +0200
***************
*** 4153,4161 ****
      int	    save_undo;
  {
      char_u	*curr = NULL;
      char_u	*cend;
      char_u	*newp;
!     char_u	*spaces;	/* number of spaces inserte before a line */
      int		endcurr1 = NUL;
      int		endcurr2 = NUL;
      int		currsize = 0;	/* size of the current line */
--- 4153,4162 ----
      int	    save_undo;
  {
      char_u	*curr = NULL;
+     char_u      *curr_start = NULL;
      char_u	*cend;
      char_u	*newp;
!     char_u	*spaces;	/* number of spaces inserted before a line */
      int		endcurr1 = NUL;
      int		endcurr2 = NUL;
      int		currsize = 0;	/* size of the current line */
***************
*** 4181,4187 ****
       */
      for (t = 0; t < count; ++t)
      {
! 	curr = ml_get((linenr_T)(curwin->w_cursor.lnum + t));
  	if (insert_space && t > 0)
  	{
  	    curr = skipwhite(curr);
--- 4182,4188 ----
       */
      for (t = 0; t < count; ++t)
      {
! 	curr = curr_start = ml_get((linenr_T)(curwin->w_cursor.lnum + t));
  	if (insert_space && t > 0)
  	{
  	    curr = skipwhite(curr);
***************
*** 4265,4274 ****
  	    copy_spaces(cend, (size_t)(spaces[t]));
  	}
  	mark_col_adjust(curwin->w_cursor.lnum + t, (colnr_T)0, (linenr_T)-t,
! 				 (long)(cend - newp + spaces[t]));
  	if (t == 0)
  	    break;
! 	curr = ml_get((linenr_T)(curwin->w_cursor.lnum + t - 1));
  	if (insert_space && t > 1)
  	    curr = skipwhite(curr);
  	currsize = (int)STRLEN(curr);
--- 4266,4275 ----
  	    copy_spaces(cend, (size_t)(spaces[t]));
  	}
  	mark_col_adjust(curwin->w_cursor.lnum + t, (colnr_T)0, (linenr_T)-t,
! 			 (long)(cend - newp + spaces[t] - (curr - curr_start)));
  	if (t == 0)
  	    break;
! 	curr = curr_start = ml_get((linenr_T)(curwin->w_cursor.lnum + t - 1));
  	if (insert_space && t > 1)
  	    curr = skipwhite(curr);
  	currsize = (int)STRLEN(curr);
*** ../vim-7.3.019/src/testdir/test68.in	2010-08-15 21:57:29.000000000 +0200
--- src/testdir/test68.in	2010-10-09 16:53:02.000000000 +0200
***************
*** 51,56 ****
--- 51,67 ----
  }
  
  STARTTEST
+ /^{/+2
+ :set tw& fo=a
+ I^^
+ ENDTEST
+ 
+ {
+    1aa
+    2bb
+ }
+ 
+ STARTTEST
  :g/^STARTTEST/.,/^ENDTEST/d
  :1;/^Results/,$wq! test.out
  ENDTEST
*** ../vim-7.3.019/src/testdir/test68.ok	2010-08-15 21:57:29.000000000 +0200
--- src/testdir/test68.ok	2010-10-09 16:53:02.000000000 +0200
***************
*** 33,35 ****
--- 33,38 ----
  #a b
  }
  
+ 
+ { 1aa ^^2bb }
+ 
*** ../vim-7.3.019/src/version.c	2010-09-30 21:03:13.000000000 +0200
--- src/version.c	2010-10-09 17:05:31.000000000 +0200
***************
*** 716,717 ****
--- 716,719 ----
  {   /* Add new patch number below this line */
+ /**/
+     20,
  /**/

-- 
Did you hear about the new 3 million dollar West Virginia State Lottery?
The winner gets 3 dollars a year for a million years.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///