summaryrefslogtreecommitdiff
path: root/misc/ruby-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'misc/ruby-mode.el')
-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 "[?$/%(){}#\"'`.:]\\|<<\\|\\[\\|\\]\\|\\<\\("