summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-12 03:49:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-12 03:49:42 +0000
commit33ede4d01ced3789d2c83bf82364389635c26a3c (patch)
tree11fef1a7095d19db94db21427e6f9d20ef2bd9f0 /misc
parentca52e3be5cbfe5a78576028813784b1790411dc2 (diff)
downloadruby-33ede4d01ced3789d2c83bf82364389635c26a3c.tar.gz
* misc/ruby-mode.el (ruby-here-doc-beg-match): fix for here-doc
which ends with an underscore. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'misc')
-rw-r--r--misc/ruby-mode.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el
index 70acd7266b..cbf944c2ab 100644
--- a/misc/ruby-mode.el
+++ b/misc/ruby-mode.el
@@ -121,13 +121,15 @@
(match-string 6)))))
(defun ruby-here-doc-beg-match ()
- (let ((contents (regexp-quote (concat (match-string 2) (match-string 3)))))
+ (let ((contents (concat
+ (regexp-quote (concat (match-string 2) (match-string 3)))
+ (if (string= (match-string 3) "_") "\\B" "\\b"))))
(concat "<<"
(let ((match (match-string 1)))
(if (and match (> (length match) 0))
(concat "\\(?:-\\([\"']?\\)\\|\\([\"']\\)" (match-string 1) "\\)"
- contents "\\b\\(\\1\\|\\2\\)")
- (concat "-?\\([\"']\\|\\)" contents "\\b\\1"))))))
+ contents "\\(\\1\\|\\2\\)")
+ (concat "-?\\([\"']\\|\\)" contents "\\1"))))))
(defconst ruby-delimiter
(concat "[?$/%(){}#\"'`.:]\\|<<\\|\\[\\|\\]\\|\\<\\("