branch: master commit c4f4095c4fd5b8c8afed4e22e94d86d8095552ac Author: ScottyB <scott.n.barn...@gmail.com> Commit: ScottyB <scott.n.barn...@gmail.com>
Only jump if not already at var or function definition --- js2-mode.el | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/js2-mode.el b/js2-mode.el index 939e904..81dfb16 100644 --- a/js2-mode.el +++ b/js2-mode.el @@ -12307,7 +12307,9 @@ it marks the next defun after the ones already marked." (parent (js2-node-parent node)) (names (if (js2-prop-get-node-p parent)(reverse (js2-names-left node)))) node-init) - (unless (js2-name-node-p node) + (unless (and (js2-name-node-p node) + (not (js2-var-init-node-p parent)) + (not (js2-function-node-p parent))) (error "Node is not a supported jump node")) (push (or (and names (pop names)) (unless (and (js2-object-prop-node-p parent)