]> code.delx.au - gnu-emacs-elpa/blobdiff - README.md
Update README
[gnu-emacs-elpa] / README.md
index 2487c82b04b55788a3cd63032e370ef1566800e5..beecc925107e2a88cb70dfa6a1b63425557f593c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -22,6 +22,47 @@ See <http://code.google.com/p/js2-mode/wiki/InstallationInstructions> for detail
 Differences between original js2-mode.el
 ========================================
 
+Supported more popular indentation style
+----------------------------------------
+
+When js2-consistent-level-indent-inner-bracket-p is non-nil
+    
+    [foo, bar, baz].forEach(function (v) {
+        if (validate(v))
+            process(v);
+    });
+    
+    [a, b, c].some(function (v) {
+        return validate(v);
+    });
+
+When js2-consistent-level-indent-inner-bracket-p is nil
+(Same as original js2-mode's indentation)
+
+    [foo, bar, baz].forEach(function (v) {
+                                if (validate(v))
+                                    process(v);
+                            });
+    
+    [a, b, c].some(function (v) {
+                       return validate(v);
+                   });
+
+Fixed ugly indentation with multi-line variable declaration
+-----------------------------------------------------------
+
+In original js2-mode.el,
+
+    var foo = 10,
+    bar = 20,
+    baz = 30;
+
+In this js2-mode.el,
+
+    var foo = 10,
+        bar = 20,
+        baz = 30;
+
 Support for abbreviated destructuring assignments
 -------------------------------------------------
 
@@ -30,6 +71,9 @@ Support for abbreviated destructuring assignments
 
     (function ({responseText}) { /* */ })(xhr); // As the argument of function
 
+    for (let [k, { name, age }] in Iterator(obj)) // nested
+        print(k, name, age);
+
 Support for expression closure in property value
 ------------------------------------------------
 
@@ -39,7 +83,7 @@ Support for expression closure in property value
         fire: function () _fire()
     };
 
-Fixed the odd indentation of "else if" with no braces
+Fixed odd indentation of "else if" with no braces
 -----------------------------------------------------
 
 In original js2-mode.el,
@@ -56,6 +100,49 @@ In this js2-mode.el,
     else if (bar)
         return bar;  // fixed
 
+Fixes in Imenu support
+----------------------
+
+Supports element-get form:
+
+    foo["bar"] = function() {};
+    foo[647] = function() {};
+
+Proper position for functions in nested object literals:
+
+    foo = {
+        bar: function() {}, // ok in original
+        baz: {
+             boop: function() {} // fixed here
+        },
+    }
+
+Imenu support for function nesting
+----------------------------------
+
+Supports one level of nesting:
+
+    function foo() {
+        function bar() { // shown as foo.bar
+            function baz() {} // hidden
+        }
+    }
+
+Top-level function can be anonymous wrapper:
+
+    (function() {
+        var foo = function() {}; // shown as foo
+    })();
+
+Examples of output:
+
+* [Underscore.js](https://github.com/documentcloud/underscore/blob/master/underscore.js)
+-> <https://gist.github.com/824262>
+* [Backbone.js](https://github.com/documentcloud/backbone/blob/master/backbone.js)
+-> <https://gist.github.com/824260>
+
+No support for library-specific extension methods like _.extend.
+
 Bugs
 ====