|
1 To: [email protected] |
|
2 Subject: Patch 7.2.026 |
|
3 Fcc: outbox |
|
4 From: Bram Moolenaar <[email protected]> |
|
5 Mime-Version: 1.0 |
|
6 Content-Type: text/plain; charset=ISO-8859-1 |
|
7 Content-Transfer-Encoding: 8bit |
|
8 ------------ |
|
9 |
|
10 Patch 7.2.026 (after 7.2.010) |
|
11 Problem: "K" doesn't use the length of the identifier but uses the rest of |
|
12 the line. |
|
13 Solution: Copy the desired number of characters first. |
|
14 Files: src/normal.c |
|
15 |
|
16 |
|
17 *** ../vim-7.2.025/src/normal.c Thu Oct 2 22:55:17 2008 |
|
18 --- src/normal.c Sat Nov 1 13:41:03 2008 |
|
19 *************** |
|
20 *** 183,188 **** |
|
21 --- 183,190 ---- |
|
22 static void nv_cursorhold __ARGS((cmdarg_T *cap)); |
|
23 #endif |
|
24 |
|
25 + static char *e_noident = N_("E349: No identifier under cursor"); |
|
26 + |
|
27 /* |
|
28 * Function to be called for a Normal or Visual mode command. |
|
29 * The argument is a cmdarg_T. |
|
30 *************** |
|
31 *** 3510,3516 **** |
|
32 if (find_type & FIND_STRING) |
|
33 EMSG(_("E348: No string under cursor")); |
|
34 else |
|
35 ! EMSG(_("E349: No identifier under cursor")); |
|
36 return 0; |
|
37 } |
|
38 ptr += col; |
|
39 --- 3512,3518 ---- |
|
40 if (find_type & FIND_STRING) |
|
41 EMSG(_("E348: No string under cursor")); |
|
42 else |
|
43 ! EMSG(_(e_noident)); |
|
44 return 0; |
|
45 } |
|
46 ptr += col; |
|
47 *************** |
|
48 *** 5472,5479 **** |
|
49 { |
|
50 /* An external command will probably use an argument starting |
|
51 * with "-" as an option. To avoid trouble we skip the "-". */ |
|
52 ! while (*ptr == '-') |
|
53 ++ptr; |
|
54 |
|
55 /* When a count is given, turn it into a range. Is this |
|
56 * really what we want? */ |
|
57 --- 5474,5490 ---- |
|
58 { |
|
59 /* An external command will probably use an argument starting |
|
60 * with "-" as an option. To avoid trouble we skip the "-". */ |
|
61 ! while (*ptr == '-' && n > 0) |
|
62 ! { |
|
63 ++ptr; |
|
64 + --n; |
|
65 + } |
|
66 + if (n == 0) |
|
67 + { |
|
68 + EMSG(_(e_noident)); /* found dashes only */ |
|
69 + vim_free(buf); |
|
70 + return; |
|
71 + } |
|
72 |
|
73 /* When a count is given, turn it into a range. Is this |
|
74 * really what we want? */ |
|
75 *************** |
|
76 *** 5520,5526 **** |
|
77 --- 5531,5539 ---- |
|
78 if (cmdchar == 'K' && !kp_help) |
|
79 { |
|
80 /* Escape the argument properly for a shell command */ |
|
81 + ptr = vim_strnsave(ptr, n); |
|
82 p = vim_strsave_shellescape(ptr, TRUE); |
|
83 + vim_free(ptr); |
|
84 if (p == NULL) |
|
85 { |
|
86 vim_free(buf); |
|
87 *** ../vim-7.2.025/src/version.c Thu Oct 2 22:55:17 2008 |
|
88 --- src/version.c Sat Nov 1 13:50:53 2008 |
|
89 *************** |
|
90 *** 678,679 **** |
|
91 --- 678,681 ---- |
|
92 { /* Add new patch number below this line */ |
|
93 + /**/ |
|
94 + 26, |
|
95 /**/ |
|
96 |
|
97 -- |
|
98 hundred-and-one symptoms of being an internet addict: |
|
99 161. You get up before the sun rises to check your e-mail, and you |
|
100 find yourself in the very same chair long after the sun has set. |
|
101 |
|
102 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ |
|
103 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
|
104 \\\ download, build and distribute -- http://www.A-A-P.org /// |
|
105 \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |