summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2007-03-27 09:02:11 +0000
committerBram Moolenaar <Bram@vim.org>2007-03-27 09:02:11 +0000
commit39353fdbec5558d5faa33cf35ff30ab96e2c366b (patch)
treebef6465f4900010ff666b9330c9b76ec21b03abf
parent5b6b1cae34a9e997bf185c269ba9e6be5b420008 (diff)
updated for version 7.0-222v7.0.222
-rw-r--r--runtime/doc/indent.txt9
-rw-r--r--src/misc1.c16
-rw-r--r--src/version.c2
3 files changed, 24 insertions, 3 deletions
diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt
index e00358334a..eefc3a46ec 100644
--- a/runtime/doc/indent.txt
+++ b/runtime/doc/indent.txt
@@ -1,4 +1,4 @@
-*indent.txt* For Vim version 7.0. Last change: 2006 Apr 30
+*indent.txt* For Vim version 7.0. Last change: 2007 Mar 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -434,10 +434,15 @@ assume a 'shiftwidth' of 4.
limits the time needed to search for the start of a comment.
(default 30 lines).
+ #N When N is non-zero recognize shell/Perl comments, starting with
+ '#'. Default N is zero: don't recognizes '#' comments. Note
+ that lines starting with # will still be seen as preprocessor
+ lines.
+
The defaults, spelled out in full, are:
cinoptions=>s,e0,n0,f0,{0,}0,^0,:s,=s,l0,b0,gs,hs,ps,ts,is,+s,c3,C0,
- /0,(2s,us,U0,w0,W0,m0,j0,)20,*30
+ /0,(2s,us,U0,w0,W0,m0,j0,)20,*30,#0
Vim puts a line in column 1 if:
- It starts with '#' (preprocessor directives), if 'cinkeys' contains '#'.
diff --git a/src/misc1.c b/src/misc1.c
index 000f3aef3e..0f75c3a4f3 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -4796,8 +4796,11 @@ static int corr_ind_maxparen __ARGS((int ind_maxparen, pos_T *startpos));
static int find_last_paren __ARGS((char_u *l, int start, int end));
static int find_match __ARGS((int lookfor, linenr_T ourscope, int ind_maxparen, int ind_maxcomment));
+static int ind_hash_comment = 0; /* # starts a comment */
+
/*
* Skip over white space and C comments within the line.
+ * Also skip over Perl/shell comments if desired.
*/
static char_u *
cin_skipcomment(s)
@@ -4805,7 +4808,17 @@ cin_skipcomment(s)
{
while (*s)
{
+ char_u *prev_s = s;
+
s = skipwhite(s);
+
+ /* Perl/shell # comment comment continues until eol. Require a space
+ * before # to avoid recognizing $#array. */
+ if (ind_hash_comment != 0 && s != prev_s && *s == '#')
+ {
+ s += STRLEN(s);
+ break;
+ }
if (*s != '/')
break;
++s;
@@ -6133,7 +6146,7 @@ get_c_indent()
if (l[1] == '-')
n = -n;
/* When adding an entry here, also update the default 'cinoptions' in
- * change.txt, and add explanation for it! */
+ * doc/indent.txt, and add explanation for it! */
switch (*l)
{
case '>': ind_level = n; break;
@@ -6166,6 +6179,7 @@ get_c_indent()
case 'h': ind_scopedecl_code = n; break;
case 'j': ind_java = n; break;
case 'l': ind_keep_case_label = n; break;
+ case '#': ind_hash_comment = n; break;
}
}
diff --git a/src/version.c b/src/version.c
index dd8741dbd0..338edba4b4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -667,6 +667,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 222,
+/**/
221,
/**/
220,