4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Perl indenting using 'cindent' works almost right.
12 Solution: Recognize '#' to start a comment. (Alex Manoussakis) Added '#'
14 Files: runtime/doc/indent.txt, src/misc1.c
17 *** ../vim-7.0.221/runtime/doc/indent.txt Sun May 7 17:00:59 2006
18 --- runtime/doc/indent.txt Sat Mar 17 16:27:57 2007
21 ! *indent.txt* For Vim version 7.0. Last change: 2006 Apr 30
24 VIM REFERENCE MANUAL by Bram Moolenaar
26 ! *indent.txt* For Vim version 7.0. Last change: 2007 Mar 17
29 VIM REFERENCE MANUAL by Bram Moolenaar
32 limits the time needed to search for the start of a comment.
36 The defaults, spelled out in full, are:
37 cinoptions=>s,e0,n0,f0,{0,}0,^0,:s,=s,l0,b0,gs,hs,ps,ts,is,+s,c3,C0,
38 ! /0,(2s,us,U0,w0,W0,m0,j0,)20,*30
40 Vim puts a line in column 1 if:
41 - It starts with '#' (preprocessor directives), if 'cinkeys' contains '#'.
43 limits the time needed to search for the start of a comment.
46 + #N When N is non-zero recognize shell/Perl comments, starting with
47 + '#'. Default N is zero: don't recognizes '#' comments. Note
48 + that lines starting with # will still be seen as preprocessor
52 The defaults, spelled out in full, are:
53 cinoptions=>s,e0,n0,f0,{0,}0,^0,:s,=s,l0,b0,gs,hs,ps,ts,is,+s,c3,C0,
54 ! /0,(2s,us,U0,w0,W0,m0,j0,)20,*30,#0
56 Vim puts a line in column 1 if:
57 - It starts with '#' (preprocessor directives), if 'cinkeys' contains '#'.
58 *** ../vim-7.0.221/src/misc1.c Tue Oct 24 21:15:09 2006
59 --- src/misc1.c Sat Mar 17 16:36:00 2007
63 static int find_last_paren __ARGS((char_u *l, int start, int end));
64 static int find_match __ARGS((int lookfor, linenr_T ourscope, int ind_maxparen, int ind_maxcomment));
66 + static int ind_hash_comment = 0; /* # starts a comment */
69 * Skip over white space and C comments within the line.
70 + * Also skip over Perl/shell comments if desired.
84 + /* Perl/shell # comment comment continues until eol. Require a space
85 + * before # to avoid recognizing $#array. */
86 + if (ind_hash_comment != 0 && s != prev_s && *s == '#')
98 /* When adding an entry here, also update the default 'cinoptions' in
99 ! * change.txt, and add explanation for it! */
102 case '>': ind_level = n; break;
106 /* When adding an entry here, also update the default 'cinoptions' in
107 ! * doc/indent.txt, and add explanation for it! */
110 case '>': ind_level = n; break;
114 case 'h': ind_scopedecl_code = n; break;
115 case 'j': ind_java = n; break;
116 case 'l': ind_keep_case_label = n; break;
117 + case '#': ind_hash_comment = n; break;
121 *** ../vim-7.0.221/src/version.c Tue Mar 27 10:20:59 2007
122 --- src/version.c Tue Mar 27 10:56:50 2007
126 { /* Add new patch number below this line */
132 My Go , this amn keyboar oesn't have a .
134 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
135 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
136 \\\ download, build and distribute -- http://www.A-A-P.org ///
137 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///