summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0722
blob: c30eeaedf50f838fee9fcb02a2c5f001669804f4 (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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0722
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0722
Problem:    Cannot build without the virtualedit feature.
Solution:   Make getviscol2() always available.
Files:	    src/misc2.c, src/proto/misc2.pro, src/ops.c


*** ../vim-8.1.0721/src/misc2.c	2018-12-28 21:59:24.512992993 +0100
--- src/misc2.c	2019-01-11 16:07:09.994655012 +0100
***************
*** 48,69 ****
  }
  
  /*
-  * Get the screen position of character col with a coladd in the cursor line.
-  */
-     int
- getviscol2(colnr_T col, colnr_T coladd)
- {
-     colnr_T	x;
-     pos_T	pos;
- 
-     pos.lnum = curwin->w_cursor.lnum;
-     pos.col = col;
-     pos.coladd = coladd;
-     getvvcol(curwin, &pos, &x, NULL, NULL);
-     return (int)x;
- }
- 
- /*
   * Go to column "wcol", and add/insert white space as necessary to get the
   * cursor in that column.
   * The caller must have saved the cursor line for undo!
--- 48,53 ----
***************
*** 86,91 ****
--- 70,93 ----
  #endif
  
  /*
+  * Get the screen position of character col with a coladd in the cursor line.
+  */
+     int
+ getviscol2(colnr_T col, colnr_T coladd)
+ {
+     colnr_T	x;
+     pos_T	pos;
+ 
+     pos.lnum = curwin->w_cursor.lnum;
+     pos.col = col;
+ #ifdef FEAT_VIRTUALEDIT
+     pos.coladd = coladd;
+ #endif
+     getvvcol(curwin, &pos, &x, NULL, NULL);
+     return (int)x;
+ }
+ 
+ /*
   * Try to advance the Cursor to the specified screen column.
   * If virtual editing: fine tune the cursor position.
   * Note that all virtual positions off the end of a line should share
*** ../vim-8.1.0721/src/proto/misc2.pro	2018-12-28 21:59:24.512992993 +0100
--- src/proto/misc2.pro	2019-01-11 16:08:07.810288364 +0100
***************
*** 1,8 ****
  /* misc2.c */
  int virtual_active(void);
  int getviscol(void);
- int getviscol2(colnr_T col, colnr_T coladd);
  int coladvance_force(colnr_T wcol);
  int coladvance(colnr_T wcol);
  int getvpos(pos_T *pos, colnr_T wcol);
  int inc_cursor(void);
--- 1,8 ----
  /* misc2.c */
  int virtual_active(void);
  int getviscol(void);
  int coladvance_force(colnr_T wcol);
+ int getviscol2(colnr_T col, colnr_T coladd);
  int coladvance(colnr_T wcol);
  int getvpos(pos_T *pos, colnr_T wcol);
  int inc_cursor(void);
*** ../vim-8.1.0721/src/ops.c	2019-01-11 14:37:16.689248837 +0100
--- src/ops.c	2019-01-11 16:09:04.201926229 +0100
***************
*** 2754,2760 ****
  			)
  	    {
  		int t = getviscol2(curbuf->b_op_start_orig.col,
! 					      curbuf->b_op_start_orig.coladd);
  		oap->start.col = curbuf->b_op_start_orig.col;
  		pre_textlen -= t - oap->start_vcol;
  		oap->start_vcol = t;
--- 2754,2765 ----
  			)
  	    {
  		int t = getviscol2(curbuf->b_op_start_orig.col,
! #ifdef FEAT_VIRTUALEDIT
! 					      curbuf->b_op_start_orig.coladd
! #else
! 					      0
! #endif
! 					      );
  		oap->start.col = curbuf->b_op_start_orig.col;
  		pre_textlen -= t - oap->start_vcol;
  		oap->start_vcol = t;
***************
*** 2771,2777 ****
  			)
  	    {
  		int t = getviscol2(curbuf->b_op_start_orig.col,
! 					      curbuf->b_op_start_orig.coladd);
  		oap->start.col = curbuf->b_op_start_orig.col;
  		/* reset pre_textlen to the value of OP_INSERT */
  		pre_textlen += bd.textlen;
--- 2776,2787 ----
  			)
  	    {
  		int t = getviscol2(curbuf->b_op_start_orig.col,
! #ifdef FEAT_VIRTUALEDIT
! 					      curbuf->b_op_start_orig.coladd
! #else
! 					      0
! #endif
! 					      );
  		oap->start.col = curbuf->b_op_start_orig.col;
  		/* reset pre_textlen to the value of OP_INSERT */
  		pre_textlen += bd.textlen;
*** ../vim-8.1.0721/src/version.c	2019-01-11 15:54:12.940038982 +0100
--- src/version.c	2019-01-11 16:08:04.106312000 +0100
***************
*** 797,798 ****
--- 797,800 ----
  {   /* Add new patch number below this line */
+ /**/
+     722,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
161. You get up before the sun rises to check your e-mail, and you
     find yourself in the very same chair long after the sun has set.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///