]> git.pld-linux.org Git - packages/vim.git/blob - 7.3.320
- new
[packages/vim.git] / 7.3.320
1 To: vim_dev@googlegroups.com
2 Subject: Patch 7.3.320
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 7.3.320
11 Problem:    When a 0xa0 character is in a sourced file the error message for
12             unrecognized command does not show the problem.
13 Solution:   Display 0xa0 as <a0>.
14 Files:      src/ex_docmd.c
15
16
17 *** ../vim-7.3.319/src/ex_docmd.c       2011-07-20 16:36:35.000000000 +0200
18 --- src/ex_docmd.c      2011-09-21 19:02:15.000000000 +0200
19 ***************
20 *** 61,66 ****
21 --- 61,67 ----
22   static char_u *do_one_cmd __ARGS((char_u **, int, char_u *(*fgetline)(int, void *, int), void *cookie));
23   static int    if_level = 0;           /* depth in :if */
24   #endif
25 + static void   append_command __ARGS((char_u *cmd));
26   static char_u *find_command __ARGS((exarg_T *eap, int *full));
27   
28   static void   ex_abbreviate __ARGS((exarg_T *eap));
29 ***************
30 *** 2136,2145 ****
31         {
32             STRCPY(IObuff, _("E492: Not an editor command"));
33             if (!sourcing)
34 !           {
35 !               STRCAT(IObuff, ": ");
36 !               STRNCAT(IObuff, *cmdlinep, 40);
37 !           }
38             errormsg = IObuff;
39         }
40         goto doend;
41 --- 2137,2143 ----
42         {
43             STRCPY(IObuff, _("E492: Not an editor command"));
44             if (!sourcing)
45 !               append_command(*cmdlinep);
46             errormsg = IObuff;
47         }
48         goto doend;
49 ***************
50 *** 2708,2715 ****
51                 STRCPY(IObuff, errormsg);
52                 errormsg = IObuff;
53             }
54 !           STRCAT(errormsg, ": ");
55 !           STRNCAT(errormsg, *cmdlinep, IOSIZE - STRLEN(IObuff) - 1);
56         }
57         emsg(errormsg);
58       }
59 --- 2706,2712 ----
60                 STRCPY(IObuff, errormsg);
61                 errormsg = IObuff;
62             }
63 !           append_command(*cmdlinep);
64         }
65         emsg(errormsg);
66       }
67 ***************
68 *** 2797,2802 ****
69 --- 2794,2835 ----
70   }
71   
72   /*
73 +  * Append "cmd" to the error message in IObuff.
74 +  * Takes care of limiting the length and handling 0xa0, which would be
75 +  * invisible otherwise.
76 +  */
77 +     static void
78 + append_command(cmd)
79 +     char_u *cmd;
80 + {
81 +     char_u *s = cmd;
82 +     char_u *d;
83
84 +     STRCAT(IObuff, ": ");
85 +     d = IObuff + STRLEN(IObuff);
86 +     while (*s != NUL && d - IObuff < IOSIZE - 7)
87 +     {
88 +       if (
89 + #ifdef FEAT_MBYTE
90 +               enc_utf8 ? (s[0] == 0xc2 && s[1] == 0xa0) :
91 + #endif
92 +               *s == 0xa0)
93 +       {
94 +           s +=
95 + #ifdef FEAT_MBYTE
96 +               enc_utf8 ? 2 :
97 + #endif
98 +               1;
99 +           STRCPY(d, "<a0>");
100 +           d += 4;
101 +       }
102 +       else
103 +           MB_COPY_CHAR(s, d);
104 +     }
105 +     *d = NUL;
106 + }
107
108 + /*
109    * Find an Ex command by its name, either built-in or user.
110    * Start of the name can be found at eap->cmd.
111    * Returns pointer to char after the command name.
112 *** ../vim-7.3.319/src/version.c        2011-09-21 18:23:02.000000000 +0200
113 --- src/version.c       2011-09-21 19:04:35.000000000 +0200
114 ***************
115 *** 711,712 ****
116 --- 711,714 ----
117   {   /* Add new patch number below this line */
118 + /**/
119 +     320,
120   /**/
121
122 -- 
123 hundred-and-one symptoms of being an internet addict:
124 28. You have comandeered your teenager's phone line for the net and even his
125     friends know not to call on his line anymore.
126
127  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
128 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
129 \\\  an exciting new programming language -- http://www.Zimbu.org        ///
130  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.039553 seconds and 3 git commands to generate.