Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong indent with arrow function in jsx expr #9

Open
HairyRabbit opened this issue Dec 17, 2017 · 0 comments
Open

wrong indent with arrow function in jsx expr #9

HairyRabbit opened this issue Dec 17, 2017 · 0 comments

Comments

@HairyRabbit
Copy link
Owner

HairyRabbit commented Dec 17, 2017

(                               // 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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant