sloanelybutsurely / vimrc.js

A vimrc that Just Works™ for modern JavaScript development
MIT License
308 stars 15 forks source link

Indentation lost on line break in the middle of the line #11

Open adriantoine opened 7 years ago

adriantoine commented 7 years ago

It's easier to understand with a gif: vimbug

If I add a new line there, the indentation is completely lost, which is very annoying. It happens sometimes at the end of the line, I've tried to google that issue but couldn't find anything. I'm only using this basic vimrc.js.

I'm using neovim in iTerm2 on Mac.

sloanelybutsurely commented 7 years ago

I'm will be taking a look at this. Thanks for opening the issue!

sloanelybutsurely commented 7 years ago

@adriantoine are you able to provide a file (perhaps via gist) that we could use to reproduce the issue?

adriantoine commented 7 years ago

Unfortunately, I can reproduce that on every file 🤔 I think I'll do some investigation on my side, I'll disable plugins one by one and see which one is causing that.

Thanks! 😊

eanplatter commented 7 years ago

I noticed some similar issues, I'll also look into this. My issues had to do with omitting semi-colons tho... 🤔

sloanelybutsurely commented 7 years ago

Don't hold your breath but my long term goal is to write a syntax and indent file from scratch that works well. Right now a lot of the syntax and indent stuff is a "getting as close as we can with what we have" situation.

davidosomething commented 7 years ago

FWIW pangloss/vim-javascript 's indent file does not have that issue: http://screencast.com/t/5oUSbdf2w Also, that indent file is part of upstream neovim now if you use neovim. I recommend switching back to that plugin if you :verb set indentexpr? is loading some other one

so no point in duplicating efforts when you can just grab the indent/ stuff from there

adriantoine commented 7 years ago

After investigating, it works when I comment out this line: https://github.com/zperrault/vimrc.js/blob/master/vimrc.plugs#L25

adriantoine commented 7 years ago

After looking at this bug: https://github.com/mxw/vim-jsx/issues/63, it works if I add:

Plug 'pangloss/vim-javascript'

in my ~/.vimrc.js/vimrc.plugs.local file.

gabrielhpugliese commented 7 years ago

Thanks @adriantoine , I was going crazy here and your solution worked for me 👍