branch: elpa/dart-mode
commit 1f65c88dbc55dfc6c7d5322e693d6d30962b27ea
Author: Philipp Stephani <[email protected]>
Commit: Natalie Weizenbaum <[email protected]>

    Add LIMIT argument for looking-back (#34)
    
    In Emacs 25, looking-back requires a LIMIT argument.
---
 dart-mode.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dart-mode.el b/dart-mode.el
index ab9cc07..b90674a 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -281,8 +281,9 @@ SYNTAX-GUESS is the output of `c-guess-basic-syntax'."
          ;; code block.
          (= (char-before) ?\))
          ;; "else" and "try" are the only keywords that come immediately before
-         ;; a block.
-         (looking-back "\\<\\(else\\|try\\)\\>")
+         ;; a block.  Look only back at most 4 characters (the length of
+         ;; "else") for performance reasons.
+         (looking-back "\\<\\(else\\|try\\)\\>" (- (point) 4))
          ;; CC is good at figuring out if we're in a class.
          (assq 'inclass syntax-guess))))))
 

Reply via email to