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

jspropertyname breaks indentation #130

Closed bounceme closed 8 years ago

bounceme commented 8 years ago

could you rename this to include string when it is written as a string ? that way property names with braces can not mess up indentation (search pair skip expressions notably)

othree commented 8 years ago

Do you mean javascriptPropertyName ?

Any sample code and how do you control indent?

bounceme commented 8 years ago
  (function() {
    console.log("value");
    var magicWords = ['abracadabra', 'gesundheit', 'ventrilo'],
      spells = {
        'f{{{{{{{ire}}}ball': function() {
          setOnFire()
        },
        'water': function() {
          putOut()
        }
      },
      a = 1,
      b = 'abc',
      etc;
    someFunc(param1, param2,
      param3, param4)
  }());

using this script: https://github.com/pangloss/vim-javascript/blob/develop/indent/javascript.vim also the matchparen/matchit plugins break.

othree commented 8 years ago

Fixed~

bounceme commented 8 years ago

great, thanks @othree !