jason0x43 / vim-js-indent

Vim indenter for standalone and embedded JavaScript
65 stars 9 forks source link

correct indent of comment block and comment line #2

Closed alvan closed 10 years ago

alvan commented 10 years ago

(function() { // js file for test

/**
 * Usage:
 *
 *  confirm([ content | title | view ]).then([ yesCallback ], [ noCallback ])
 *  Ex.
 *          PopUp
 *          .confirm({
     *              content: "Are you sure to..."
     *          })
     *          .then(function(){
         *              console.log('say yes');
         *          }, function(){
             *              console.log('say no');
             *          })
             *          .then ...
             */
            var f = function(a, b, cdedfg) {
                /*
                 * some comments
                 */
                return (sign + arr.join(':').replace(/\b(\d)\b/g, "0$1"));
            };

            // var f2 = function(second, digit) {
            //     var arr = [],
            //         sign = '';
            //     var test = 'zz';
            //     var qq = 'ddd';

            //     if (0 < second) {
            //         sign = '+';
            //     }
            // };

            var urlError = function() {
                /* hahah */
                throw new Error('A "url" property or function must be specified');
            };

})();

jason0x43 commented 10 years ago

Works great -- thanks!