4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Ruby: "ruby << EOF" inside a function doesn't always work. Also
12 for ":python", ":tcl" and ":perl".
13 Solution: Check for "<< marker" and skip until "marker" before checking for
18 *** ../vim-6.2.411/src/eval.c Mon Mar 29 14:32:19 2004
19 --- src/eval.c Mon Mar 29 15:25:42 2004
25 ! int in_append = FALSE;
26 static char_u e_funcexts[] = N_("E122: Function %s already exists, add ! to replace it");
33 ! char_u *skip_until = NULL;
34 static char_u e_funcexts[] = N_("E122: Function %s already exists, add ! to replace it");
44 ! /* between ":append" and "." there is no check for ":endfunc". */
45 ! if (theline[0] == '.' && theline[1] == NUL)
54 ! if (skip_until != NULL)
56 ! /* between ":append" and "." and between ":python <<EOF" and "EOF"
57 ! * don't check for ":endfunc". */
58 ! if (STRCMP(theline, skip_until) == 0)
60 ! vim_free(skip_until);
69 && (!ASCII_ISALPHA(p[1]) || (p[1] == 'n'
70 && (!ASCII_ISALPHA(p[2]) || (p[2] == 's'))))))
74 /* Add the line to the function. */
77 && (!ASCII_ISALPHA(p[1]) || (p[1] == 'n'
78 && (!ASCII_ISALPHA(p[2]) || (p[2] == 's'))))))
79 ! skip_until = vim_strsave((char_u *)".");
81 ! /* Check for ":python <<EOF", ":tcl <<EOF", etc. */
82 ! arg = skipwhite(skiptowhite(p));
83 ! if (arg[0] == '<' && arg[1] =='<'
84 ! && ((p[0] == 'p' && p[1] == 'y'
85 ! && (!ASCII_ISALPHA(p[2]) || p[2] == 't'))
86 ! || (p[0] == 'p' && p[1] == 'e'
87 ! && (!ASCII_ISALPHA(p[2]) || p[2] == 'r'))
88 ! || (p[0] == 't' && p[1] == 'c'
89 ! && (!ASCII_ISALPHA(p[2]) || p[2] == 'l'))
90 ! || (p[0] == 'r' && p[1] == 'u' && p[2] == 'b'
91 ! && (!ASCII_ISALPHA(p[3]) || p[3] == 'y'))
94 ! /* ":python <<" continues until a dot, like ":append" */
95 ! p = skipwhite(arg + 2);
97 ! skip_until = vim_strsave((char_u *)".");
99 ! skip_until = vim_strsave(p);
103 /* Add the line to the function. */
107 #ifdef FEAT_MAGIC_BRACES
108 did_emsg |= saved_did_emsg;
110 + vim_free(skip_until);
114 + vim_free(skip_until);
115 ga_clear_strings(&newargs);
116 ga_clear_strings(&newlines);
118 *** ../vim-6.2.411/src/version.c Mon Mar 29 14:32:19 2004
119 --- src/version.c Mon Mar 29 16:11:00 2004
123 { /* Add new patch number below this line */
129 If Microsoft would build a car...
130 ... the oil, water temperature, and alternator warning lights would
131 all be replaced by a single "General Protection Fault" warning light.
133 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
134 /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
135 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
136 \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///