mxw / vim-jsx

React JSX syntax highlighting and indenting for vim.
1.59k stars 95 forks source link

New line indentation within classes #151

Closed dvcrn closed 7 years ago

dvcrn commented 7 years ago

Hi! Followed both install instructions for this and pangloss/vim-javascript

Code: (|| indicates cursor position)

class Foo { ||
  constructor(props) {

  }
}

hitting enter puts the cursor on

class Foo { 
||
  constructor(props) {

  }
}

instead of

class Foo { 
  ||
  constructor(props) {

  }
}

Similar all motions that act on lines like o, dd, cc put the cursor at the beginning of the line instead of the correctly indented position. This only happens when I use let g:jsx_ext_required = 0.

Any advise on how I can debug this?

mxw commented 7 years ago

I can't repro. Could you please read the README and update this issue with the appropriate details?

dvcrn commented 7 years ago

I figured out what it was. I had vim-polyglot and pangloss/vim-javascript installed at the same time. pangloss/vim-javascript is already in polyglot and that somehow conflicted. Removing either package fixes the indentation issue I had