Skip to content

wrong indent with arrow function in jsx expr #9

@HairyRabbit

Description

@HairyRabbit
(                               // 1
    <div>                       // find 1
      <div>                     // find 1
        {(                      // 2
            <div>               // find 2
            </div>              // find 2
        )}                      // find 2
    </div>                      // find 2, but should be 1
        </div>                  // same as 2
)

because js.el js--jsx-find-before-tag only stopped when find the frist begin flag.

(defsubst js--jsx-find-before-tag ()
  (let (pos)
    (while (and (> (point) (point-min))
                (not (progn
                       (end-of-line 0)
                       (when (or (eq (char-before) 40)   ; (
                                 (eq (char-before) 44))  ; ,
                         (setq pos (1- (point))))))))
    pos))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions