diff src/testdir/test3.in @ 6691:c4cb95fb4c58 v7.4.670

updated for version 7.4.670 Problem: Using 'cindent' for Javascript is less than perfect. Solution: Improve indenting of continuation lines. (Hirohito Higashi)
author Bram Moolenaar <bram@vim.org>
date Fri, 20 Mar 2015 19:06:06 +0100
parents 65b0974c5beb
children e859731ea1cd
line wrap: on
line diff
--- a/src/testdir/test3.in
+++ b/src/testdir/test3.in
@@ -2065,6 +2065,164 @@ return true;
 JSEND
 
 STARTTEST
+:set cino=j1,J1,+2
+/^JSSTART
+=/^JSEND
+ENDTEST
+
+JSSTART
+// Results of JavaScript indent
+// 1
+(function(){
+var a = [
+'a',
+'b',
+'c',
+'d',
+'e',
+'f',
+'g',
+'h',
+'i'
+];
+}())
+
+// 2
+(function(){
+var a = [
+0 +
+5 *
+9 *
+'a',
+'b',
+0 +
+5 *
+9 *
+'c',
+'d',
+'e',
+'f',
+'g',
+'h',
+'i'
+];
+}())
+
+// 3
+(function(){
+var a = [
+0 +
+// comment 1
+5 *
+/* comment 2 */
+9 *
+'a',
+'b',
+0 +
+5 *
+9 *
+'c',
+'d',
+'e',
+'f',
+'g',
+'h',
+'i'
+];
+}())
+
+// 4
+{
+var a = [
+0,
+1
+];
+var b;
+var c;
+}
+
+// 5
+{
+var a = [
+[
+0
+],
+2,
+3
+];
+}
+
+// 6
+{
+var a = [
+[
+0,
+1
+],
+2,
+3
+];
+}
+
+// 7
+{
+var a = [
+// [
+0,
+// 1
+// ],
+2,
+3
+];
+}
+
+// 8
+var x = [
+(function(){
+var a,
+b,
+c,
+d,
+e,
+f,
+g,
+h,
+i;
+})
+];
+
+// 9
+var a = [
+0 +
+5 *
+9 *
+'a',
+'b',
+0 +
+5 *
+9 *
+'c',
+'d',
+'e',
+'f',
+'g',
+'h',
+'i'
+];
+
+// 10
+var a,
+b,
+c,
+d,
+e,
+f,
+g,
+h,
+i;
+JSEND
+
+STARTTEST
 :g/^STARTTEST/.,/^ENDTEST/d
 :1;/start of AUTO/,$wq! test.out
 ENDTEST