Hari Kumar G wrote:
> Vim uses cindent for JS files which works in general nicely.
> There are a few cases where this does not work correctly. F.e.
>
> var a = {
> b: 1,
> c: "hello"
> }
>
> cindent would align b: 1 to col 0 and indent c: "hello" by
> shiftwidth. This is because of how it treats labels in C.
> The attached fix avoids this by using another 'cindentoption'
> value 'J' so that such lines could be treated differently if
> the file is a JS file.
Please review this recently-added tip:
http://vim.wikia.com/wiki/Improved_Javascript_Indent_script_for_Vim
It would be great if you were to determine what works best
(combining your script with the above) and take Bram's
suggestion to become the maintainer for the Javascript indent
file distributed with Vim. If you make a decision, whether 'yes'
or 'no', I would like to hear about it because we would not want
to keep a tip that was simply an indent script distributed with
Vim.
John
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php