* lisp/progmodes/ruby-mode.el (ruby-smie--forward-token)
authorDmitry Gutov <dgutov@yandex.ru>
Fri, 8 Nov 2013 21:23:11 +0000 (23:23 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Fri, 8 Nov 2013 21:23:11 +0000 (23:23 +0200)
(ruby-smie--backward-token): Only consider full-string matches.

lisp/ChangeLog
lisp/progmodes/ruby-mode.el

index 0781971..e2aa935 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-08  Dmitry Gutov  <dgutov@yandex.ru>
+
+       * progmodes/ruby-mode.el (ruby-smie--forward-token)
+       (ruby-smie--backward-token): Only consider full-string matches.
+
 2013-11-08  Jan Djärv  <jan.h.d@swipnet.se>
 
        * faces.el (describe-face): Add distant-foreground.
index 1602848..7b40bf5 100644 (file)
@@ -438,7 +438,7 @@ explicitly declared in magic comment."
            ((member tok '("unless" "if" "while" "until"))
             (if (save-excursion (forward-word -1) (ruby-smie--bosp))
                 tok "iuwu-mod"))
-           ((string-match "|[*&]?" tok)
+           ((string-match-p "\\`|[*&]?\\'" tok)
             (forward-char (- 1 (length tok)))
             (setq tok "|")
             (if (ruby-smie--opening-pipe-p) "opening-|" tok))
@@ -482,7 +482,7 @@ explicitly declared in magic comment."
               tok "iuwu-mod"))
          ((equal tok "|")
           (if (ruby-smie--opening-pipe-p) "opening-|" tok))
-         ((string-match-p "|[*&]" tok)
+         ((string-match-p "\\`|[*&]\\'" tok)
           (forward-char 1)
           (substring tok 1))
          ((and (equal tok "") (eq ?\\ (char-before)) (looking-at "\n"))