swift-emacs / swift-mode

Emacs support for Apple's Swift programming language.
GNU General Public License v3.0
372 stars 47 forks source link

Fix matching paren #101

Closed uk-ar closed 8 years ago

uk-ar commented 9 years ago

I fixed mismatched paren issue at curly bracket(#35) and add test for this.

ap4y commented 9 years ago

Hey @uk-ar I tested your branch with clean emacs (via cask exec emacs -Q -l swift-mode.el) and still getting Mismatched paretheses. For example:

class Test {
} <- here

I also don't think I entirely understand the test case, wonder if I'm missing something :). Why we test against closer with (smie--opener/closer-at-point) 2 times? In position 2 we have } which is closer, so we correctly expect nil, but in position 1 we have { which should be an opener, right?

And a really small issue, there is a typo in comment string in the test case ;; { is follen back to syntax table base match, follen probably supposed to be fallen. Maybe ;; { should fall back to the syntax table base match will sound better, but I'm not sure how this fits into context of the test case?

uk-ar commented 9 years ago

Sorry I found a bug in this PR. I will investigate this.

taku0 commented 8 years ago

Closing in favor of the new indentation logic.