]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.213 v7.3.213
authorBram Moolenaar <Bram@vim.org>
Sun, 12 Jun 2011 19:51:08 +0000 (21:51 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 12 Jun 2011 19:51:08 +0000 (21:51 +0200)
Problem:    Javascript object literal is not indented correctly.
Solution:   Make a special case for when "J1" is in 'cino'. (Luc Deschenaux)

src/misc1.c
src/testdir/test3.in
src/testdir/test3.ok
src/version.c

index 913da2ad79bc1b7fe24bc8e1108155795578cc92..d69f12fd29ce5d0639d38a5df2e04d56921b83b2 100644 (file)
@@ -6965,7 +6965,7 @@ get_c_indent()
             *                  ldfd) {
             *              }
             */
-           if ((ind_keep_case_label
+           if (ind_js || (ind_keep_case_label
                           && cin_iscase(skipwhite(ml_get_curline()), FALSE)))
                amount = get_indent();
            else
index 1b5cf893bb5065160518b061c7a73d19209bca2f..1cfd8f23ee5ae89e0149c21ad874a7513abd2a0f 100644 (file)
@@ -1492,10 +1492,11 @@ baz();
 
 STARTTEST
 :set cino=N-s
-/namespaces
+/^NAMESPACESTART
 =/^NAMESPACEEND
 ENDTEST
 
+NAMESPACESTART
 /* valid namespaces with normal indent */
 namespace
 {
@@ -1560,6 +1561,27 @@ namespace111111111
 NAMESPACEEND
 
 
+STARTTEST
+:set cino=J1
+/^JSSTART
+=/^JSEND
+ENDTEST
+
+JSSTART
+var bar = {
+foo: {
+that: this,
+some: ok,
+},
+"bar":{
+a : 2,
+b: "123abc",
+x: 4,
+"y": 5
+}
+}
+JSEND
+
 STARTTEST
 :g/^STARTTEST/.,/^ENDTEST/d
 :1;/start of AUTO/,$wq! test.out
index cf4f85deb5705c0905186060548138e6ff4a774d..8475aff9feff25d9f8eebd27b751aca08aa30ee5 100644 (file)
@@ -1337,6 +1337,7 @@ void func(void)
 }
 
 
+NAMESPACESTART
 /* valid namespaces with normal indent */
 namespace
 {
@@ -1401,3 +1402,19 @@ namespace111111111
 NAMESPACEEND
 
 
+
+JSSTART
+var bar = {
+       foo: {
+               that: this,
+               some: ok,
+       },
+       "bar":{
+               a : 2,
+               b: "123abc",
+               x: 4,
+               "y": 5
+       }
+}
+JSEND
+
index f648160ca0762f50e2e251d1c78b6aa5b88bc483..7ae798422a12efbef679d8df7642c9edf05dd45f 100644 (file)
@@ -709,6 +709,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    213,
 /**/
     212,
 /**/