othree / yajs.vim

YAJS.vim: Yet Another JavaScript Syntax for Vim
http://www.vim.org/scripts/script.php?script_id=4974
Vim License
688 stars 41 forks source link

Semicolon-less style is not support for first line in function #110

Closed guileen closed 8 years ago

guileen commented 8 years ago

Check code inside function foo and bar, the indent is wrong.

console.log('hello')
console.log('hello')
console.log('hello')
var a = 1
var b = 2
var c = 3

function foo(a, b) {
    console.log('hello')
        console.log('hello')
        console.log('hello')
        var a = 1
        var b=2
        var c=3
}

function bar() {
    var a = 1
        var b = 2
        var c = 3
        console.log('hello')
        console.log('hello')
        console.log('hello')
}

console.log('hello')
console.log('hello')
console.log('hello')
var a = 1
var b = 2
var c = 3
othree commented 8 years ago

Indent is not related to yajs.

Maybe you can use https://github.com/jiangmiao/simple-javascript-indenter