]> git.pld-linux.org Git - packages/vim.git/blame - 7.3.074
- new
[packages/vim.git] / 7.3.074
CommitLineData
fa254b05
AG
1To: vim_dev@googlegroups.com
2Subject: Patch 7.3.074
3Fcc: outbox
4From: Bram Moolenaar <Bram@moolenaar.net>
5Mime-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8------------
9
10Patch 7.3.074
11Problem: Can't use the "+ register like "* for yank and put.
12Solution: Add "unnamedplus" to the 'clipboard' option. (Ivan Krasilnikov)
13Files: runtime/doc/options.txt, src/eval.c, src/globals.h, src/ops.c,
14 src/option.c
15
16
17*** ../vim-7.3.073/runtime/doc/options.txt 2010-12-02 16:01:23.000000000 +0100
18--- runtime/doc/options.txt 2010-12-02 21:22:48.000000000 +0100
19***************
20*** 1434,1439 ****
21--- 1434,1448 ----
22 explicitly accessed using the "* notation. Also see
23 |gui-clipboard|.
24
25+ unnamedplus A variant of "unnamed" flag which uses the clipboard
26+ register '+' (|quoteplus|) instead of register '*' for
27+ all operations except yank. Yank shall copy the text
28+ into register '+' and also into '*' when "unnamed" is
29+ included.
30+ Only available with the |+x11| feature.
31+ Availability can be checked with: >
32+ if has('unnamedplus')
33+ <
34 autoselect Works like the 'a' flag in 'guioptions': If present,
35 then whenever Visual mode is started, or the Visual
36 area extended, Vim tries to become the owner of the
37*** ../vim-7.3.073/src/eval.c 2010-12-02 14:47:56.000000000 +0100
38--- src/eval.c 2010-12-02 17:30:23.000000000 +0100
39***************
40*** 12135,12140 ****
41--- 12139,12147 ----
42 #ifdef FEAT_TOOLBAR
43 "toolbar",
44 #endif
45+ #if defined(FEAT_CLIPBOARD) && defined(FEAT_X11)
46+ "unnamedplus",
47+ #endif
48 #ifdef FEAT_USR_CMDS
49 "user-commands", /* was accidentally included in 5.4 */
50 "user_commands",
51*** ../vim-7.3.073/src/globals.h 2010-11-24 14:28:53.000000000 +0100
52--- src/globals.h 2010-12-02 20:07:42.000000000 +0100
53***************
54*** 512,518 ****
55 # define clip_plus clip_star /* there is only one clipboard */
56 # define ONE_CLIPBOARD
57 # endif
58! EXTERN int clip_unnamed INIT(= FALSE);
59 EXTERN int clip_autoselect INIT(= FALSE);
60 EXTERN int clip_autoselectml INIT(= FALSE);
61 EXTERN int clip_html INIT(= FALSE);
62--- 512,522 ----
63 # define clip_plus clip_star /* there is only one clipboard */
64 # define ONE_CLIPBOARD
65 # endif
66!
67! #define CLIP_UNNAMED 1
68! #define CLIP_UNNAMED_PLUS 2
69! EXTERN int clip_unnamed INIT(= 0); /* above two values or'ed */
70!
71 EXTERN int clip_autoselect INIT(= FALSE);
72 EXTERN int clip_autoselectml INIT(= FALSE);
73 EXTERN int clip_html INIT(= FALSE);
74*** ../vim-7.3.073/src/ops.c 2010-11-24 14:28:53.000000000 +0100
75--- src/ops.c 2010-12-02 21:33:04.000000000 +0100
76***************
77*** 1584,1592 ****
78 adjust_clip_reg(rp)
79 int *rp;
80 {
81! /* If no reg. specified, and "unnamed" is in 'clipboard', use '*' reg. */
82! if (*rp == 0 && clip_unnamed)
83! *rp = '*';
84 if (!clip_star.available && *rp == '*')
85 *rp = 0;
86 if (!clip_plus.available && *rp == '+')
87--- 1584,1594 ----
88 adjust_clip_reg(rp)
89 int *rp;
90 {
91! /* If no reg. specified, and "unnamed" or "unnamedplus" is in 'clipboard',
92! * use '*' or '+' reg, respectively. "unnamedplus" prevails. */
93! if (*rp == 0 && clip_unnamed != 0)
94! *rp = ((clip_unnamed & CLIP_UNNAMED_PLUS) && clip_plus.available)
95! ? '+' : '*';
96 if (!clip_star.available && *rp == '*')
97 *rp = 0;
98 if (!clip_plus.available && *rp == '+')
99***************
100*** 2842,2847 ****
101--- 2844,2850 ----
102 char_u *p;
103 char_u *pnew;
104 struct block_def bd;
105+ int did_star = FALSE;
106
107 /* check for read-only register */
108 if (oap->regname != 0 && !valid_yank_reg(oap->regname, TRUE))
109***************
110*** 3115,3121 ****
111 */
112 if (clip_star.available
113 && (curr == &(y_regs[STAR_REGISTER])
114! || (!deleting && oap->regname == 0 && clip_unnamed)))
115 {
116 if (curr != &(y_regs[STAR_REGISTER]))
117 /* Copy the text from register 0 to the clipboard register. */
118--- 3118,3125 ----
119 */
120 if (clip_star.available
121 && (curr == &(y_regs[STAR_REGISTER])
122! || (!deleting && oap->regname == 0
123! && (clip_unnamed & CLIP_UNNAMED))))
124 {
125 if (curr != &(y_regs[STAR_REGISTER]))
126 /* Copy the text from register 0 to the clipboard register. */
127***************
128*** 3123,3128 ****
129--- 3127,3133 ----
130
131 clip_own_selection(&clip_star);
132 clip_gen_set_selection(&clip_star);
133+ did_star = TRUE;
134 }
135
136 # ifdef FEAT_X11
137***************
138*** 3130,3141 ****
139 * If we were yanking to the '+' register, send result to selection.
140 * Also copy to the '*' register, in case auto-select is off.
141 */
142! else if (clip_plus.available && curr == &(y_regs[PLUS_REGISTER]))
143 {
144 /* No need to copy to * register upon 'unnamed' now - see below */
145 clip_own_selection(&clip_plus);
146 clip_gen_set_selection(&clip_plus);
147! if (!clip_isautosel())
148 {
149 copy_yank_reg(&(y_regs[STAR_REGISTER]));
150 clip_own_selection(&clip_star);
151--- 3135,3153 ----
152 * If we were yanking to the '+' register, send result to selection.
153 * Also copy to the '*' register, in case auto-select is off.
154 */
155! if (clip_plus.available
156! && (curr == &(y_regs[PLUS_REGISTER])
157! || (!deleting && oap->regname == 0
158! && (clip_unnamed & CLIP_UNNAMED_PLUS))))
159 {
160+ if (curr != &(y_regs[PLUS_REGISTER]))
161+ /* Copy the text from register 0 to the clipboard register. */
162+ copy_yank_reg(&(y_regs[PLUS_REGISTER]));
163+
164 /* No need to copy to * register upon 'unnamed' now - see below */
165 clip_own_selection(&clip_plus);
166 clip_gen_set_selection(&clip_plus);
167! if (!clip_isautosel() && !did_star)
168 {
169 copy_yank_reg(&(y_regs[STAR_REGISTER]));
170 clip_own_selection(&clip_star);
171*** ../vim-7.3.073/src/option.c 2010-12-02 16:01:23.000000000 +0100
172--- src/option.c 2010-12-02 21:41:32.000000000 +0100
173***************
174*** 7307,7313 ****
175 static char_u *
176 check_clipboard_option()
177 {
178! int new_unnamed = FALSE;
179 int new_autoselect = FALSE;
180 int new_autoselectml = FALSE;
181 int new_html = FALSE;
182--- 7307,7313 ----
183 static char_u *
184 check_clipboard_option()
185 {
186! int new_unnamed = 0;
187 int new_autoselect = FALSE;
188 int new_autoselectml = FALSE;
189 int new_html = FALSE;
190***************
191*** 7319,7327 ****
192 {
193 if (STRNCMP(p, "unnamed", 7) == 0 && (p[7] == ',' || p[7] == NUL))
194 {
195! new_unnamed = TRUE;
196 p += 7;
197 }
198 else if (STRNCMP(p, "autoselect", 10) == 0
199 && (p[10] == ',' || p[10] == NUL))
200 {
201--- 7319,7333 ----
202 {
203 if (STRNCMP(p, "unnamed", 7) == 0 && (p[7] == ',' || p[7] == NUL))
204 {
205! new_unnamed |= CLIP_UNNAMED;
206 p += 7;
207 }
208+ else if (STRNCMP(p, "unnamedplus", 11) == 0
209+ && (p[11] == ',' || p[11] == NUL))
210+ {
211+ new_unnamed |= CLIP_UNNAMED_PLUS;
212+ p += 11;
213+ }
214 else if (STRNCMP(p, "autoselect", 10) == 0
215 && (p[10] == ',' || p[10] == NUL))
216 {
217*** ../vim-7.3.073/src/version.c 2010-12-02 17:09:48.000000000 +0100
218--- src/version.c 2010-12-02 21:34:40.000000000 +0100
219***************
220*** 716,717 ****
221--- 716,719 ----
222 { /* Add new patch number below this line */
223+ /**/
224+ 74,
225 /**/
226
227--
228The budget process was invented by an alien race of sadistic beings who
229resemble large cats.
230 (Scott Adams - The Dilbert principle)
231
232 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
233/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
234\\\ an exciting new programming language -- http://www.Zimbu.org ///
235 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
This page took 0.07037 seconds and 4 git commands to generate.