diff --git a/mode_perl.py b/mode_perl.py index b7606ab..4a6a951 100644 --- a/mode_perl.py +++ b/mode_perl.py @@ -114,10 +114,11 @@ class PerlTabber(tab2.StackTabber): self._opt_pop('cont') currlvl = tab2.StackTabber._handle_close_token(self, currlvl, y, i) token = self.get_token(y, i) - if token.string == '}': - self._opt_pop('cont') - elif self.is_rightmost_token(y, i): - self._opt_append('cont', currlvl + 4) + if self.is_rightmost_token(y, i): + if token.string == '}': + self._opt_pop('cont') + else: + self._opt_append('cont', currlvl + 4) return currlvl def _handle_other_token(self, currlvl, y, i): token = self.get_token(y, i)