From 3acfc30409eb8e3721d888f2e7111111057fe937 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 11 Jul 2010 17:23:02 +0200 Subject: Improve Javascript indenting. Add "J" flag to 'cino'. (Hari Kumar G) --- runtime/doc/indent.txt | 18 ++++++++++++++++++ runtime/doc/todo.txt | 3 +-- runtime/indent/javascript.vim | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index 355c90996..410fe38ea 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -430,6 +430,24 @@ assume a 'shiftwidth' of 4. do_something(); } }); +< + *javascript-cinoptions* *javascript-indenting* + JN Indent JavaScript object declarations correctly by not confusing + them with labels. The value 'N' is currently unused but must be + non-zero (e.g. 'J1'). > + + var bar = { + foo: { + that: this, + some: ok, + }, + "bar":{ + a : 2, + b: "123abc", + x: 4, + "y": 5 + } + } < )N Vim searches for unclosed parentheses at most N lines away. This limits the time needed to search for parentheses. (default diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 838fca9f2..60cc35555 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1089,11 +1089,10 @@ Patch to support horizontal scroll wheel in GTK. Untested. (Bjorn Winckler, Vim 7.3: -- soon: remove UF_VERSION_CRYPT_PREV and UF_VERSION_PREV. +- Soon: remove UF_VERSION_CRYPT_PREV and UF_VERSION_PREV. - Conceal feature: no update when moving to another window. (Dominique Pelle, 2010 Jul 5) Vince will look into it. Patches to possibly include: -- Patch to support :browse for more commands. (Lech Lorens, 2009 Jul 18) - Patch to improve javascript indenting. (Hari Kumar G, 2010 May 22) - Patch to use return value of 'formatexpr'. (James Vega, 2010 Jun 16) - Patch for gtk main_loop() to enable GtkFileChooser. (James Vega, 2010 Jun 28) diff --git a/runtime/indent/javascript.vim b/runtime/indent/javascript.vim index cf4a4f3ce..a83d34b11 100644 --- a/runtime/indent/javascript.vim +++ b/runtime/indent/javascript.vim @@ -11,5 +11,6 @@ let b:did_indent = 1 " C indenting is not too bad. setlocal cindent +setlocal cinoptions+=j1,J1 let b:undo_indent = "setl cin<" -- cgit v1.2.3