]> git.eshelyaron.com Git - emacs.git/commitdiff
* 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 0781971c38fa612aa6affa3bdf1282a2d6535128..e2aa935d3477778a3e4879ad6321ae4bbaa96a89 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 1602848c7128db0708f4f9e29006025cf55f4d24..7b40bf536f86f2c5260874621e5818d432e0b69f 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"))