From ffa2df72a8142426b5f173439a257968e44b69fd Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Fri, 8 Nov 2013 23:23:11 +0200 Subject: [PATCH] * lisp/progmodes/ruby-mode.el (ruby-smie--forward-token) (ruby-smie--backward-token): Only consider full-string matches. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/ruby-mode.el | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0781971c38f..e2aa935d347 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-11-08 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-smie--forward-token) + (ruby-smie--backward-token): Only consider full-string matches. + 2013-11-08 Jan Djärv * faces.el (describe-face): Add distant-foreground. diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 1602848c712..7b40bf536f8 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -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")) -- 2.39.2