]> git.pld-linux.org Git - packages/vim.git/blame - 7.3.713
- add patches 7.3.619-743
[packages/vim.git] / 7.3.713
CommitLineData
5a088057
KK
1To: vim_dev@googlegroups.com
2Subject: Patch 7.3.713
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.713
11Problem: printf() can only align to bytes, not characters.
12Solution: Add the "S" item. (Christian Brabandt)
13Files: runtime/doc/eval.txt, src/message.c
14
15
16*** ../vim-7.3.712/runtime/doc/eval.txt 2012-10-21 00:44:59.000000000 +0200
17--- runtime/doc/eval.txt 2012-11-14 18:00:40.000000000 +0100
18***************
19*** 4427,4432 ****
20--- 4451,4457 ----
21
22 Often used items are:
23 %s string
24+ %6S string right-aligned in 6 display cells
25 %6s string right-aligned in 6 bytes
26 %.9s string truncated to 9 bytes
27 %c single byte
28***************
29*** 4541,4546 ****
30--- 4566,4575 ----
31 s The text of the String argument is used. If a
32 precision is specified, no more bytes than the number
33 specified are used.
34+ S The text of the String argument is used. If a
35+ precision is specified, no more display cells than the
36+ number specified are used. Without the |+multi_byte|
37+ feature works just like 's'.
38
39 *printf-f* *E807*
40 f The Float argument is converted into a string of the
41*** ../vim-7.3.712/src/message.c 2012-03-28 16:49:25.000000000 +0200
42--- src/message.c 2012-11-14 17:58:25.000000000 +0100
43***************
44*** 4290,4295 ****
45--- 4290,4296 ----
46 case '%':
47 case 'c':
48 case 's':
49+ case 'S':
50 length_modifier = '\0';
51 str_arg_l = 1;
52 switch (fmt_spec)
53***************
54*** 4318,4323 ****
55--- 4319,4325 ----
56 }
57
58 case 's':
59+ case 'S':
60 str_arg =
61 #ifndef HAVE_STDARG_H
62 (char *)get_a_arg(arg_idx);
63***************
64*** 4354,4359 ****
65--- 4356,4379 ----
66 str_arg_l = (q == NULL) ? precision
67 : (size_t)(q - str_arg);
68 }
69+ #ifdef FEAT_MBYTE
70+ if (fmt_spec == 'S')
71+ {
72+ if (min_field_width != 0)
73+ min_field_width += STRLEN(str_arg)
74+ - mb_string2cells((char_u *)str_arg, -1);
75+ if (precision)
76+ {
77+ char_u *p1 = (char_u *)str_arg;
78+ size_t i;
79+
80+ for (i = 0; i < precision && *p1; i++)
81+ p1 += mb_ptr2len(p1);
82+
83+ str_arg_l = precision = p1 - (char_u *)str_arg;
84+ }
85+ }
86+ #endif
87 break;
88
89 default:
90*** ../vim-7.3.712/src/version.c 2012-10-23 05:35:30.000000000 +0200
91--- src/version.c 2012-11-14 17:54:12.000000000 +0100
92***************
93*** 727,728 ****
94--- 727,730 ----
95 { /* Add new patch number below this line */
96+ /**/
97+ 713,
98 /**/
99
100--
101In many of the more relaxed civilizations on the Outer Eastern Rim of the
102Galaxy, "The Hitchhiker's Guide to the Galaxy" has already supplanted the
103great "Encyclopedia Galactica" as the standard repository of all knowledge
104and wisdom, for though it has many omissions and contains much that is
105apocryphal, or at least wildly inaccurate, it scores over the older, more
106pedestrian work in two important respects.
107First, it is slightly cheaper; and second, it has the words "DON'T PANIC"
108inscribed in large friendly letters on its cover.
109 -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
110
111 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
112/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
113\\\ an exciting new programming language -- http://www.Zimbu.org ///
114 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
This page took 0.04793 seconds and 4 git commands to generate.