Closed amadeus closed 4 years ago
i'm looking into it! this definetly needs a fix
so the offending function is here: https://github.com/pangloss/vim-javascript/blob/master/indent/javascript.vim#L290
the reason so far as i can tell is that it cant find the opening brace of the object before the timeout here: https://github.com/pangloss/vim-javascript/blob/master/indent/javascript.vim#L395 so it wants to find the start of a continued expression and the loop in isContOne runs like 6000 times
so basically just need to limit the looping in that function. will fix soon
also limiting the looping will prevent the time lag, but it will probably make the indent incorrect, which is a tradeoff well worth it in these unusual spots
I know nothing about how indentation works - but is it possible it could just grab the syntax group it's in - and just match from there?
I.E. if it's in a jsObject
and the previous line ends on a comma - match the current indent or something?
you just gave me an idea.... basically a short circuit to get indent in objects really easily. i'll be working on this
I've attached a gist to use as an example
https://gist.github.com/amadeus/139a4a8d711a18444b0699bdea2ea27c
If you put your cursor on line 6001, and press
o
to jump into insert mode on a new line, it will be a bit laggy. If you press enter a few times while in insert mode, you get even more lag.Is there a way we can optimize this use case @bounceme?