From c2a9b62fd2f5c107fcff2e21052e4e9e2294e8ce Mon Sep 17 00:00:00 2001 From: matz Date: Sat, 30 Oct 2004 15:33:03 +0000 Subject: * string.c (rb_str_locktmp): lock string temporarily. * string.c (str_independent): add tmplock check. * io.c (io_write): lock output string temporarily. [ruby-dev:24649] * io.c (io_write): use rb_str_locktmp(). * io.c (read_all): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- misc/ruby-mode.el | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'misc/ruby-mode.el') diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el index 462ec609be..041ddc66ff 100644 --- a/misc/ruby-mode.el +++ b/misc/ruby-mode.el @@ -521,10 +521,23 @@ The variable ruby-indent-level controls the amount of indentation. (looking-at "<<\\(-\\)?\\(\\([\"'`]\\)\\([^\n]+?\\)\\3\\|\\sw+\\)")) (setq re (regexp-quote (or (match-string 4) (match-string 2)))) (if (match-beginning 1) (setq re (concat "\\s *" re))) - (if (re-search-forward (concat "^" re "$") end 'move) - (forward-line 1) - (setq in-string (match-end 0)) - (goto-char end))) + (let* ((id-end (goto-char (match-end 0))) + (line-end-position (save-excursion (end-of-line) (point))) + (state (list in-string nest depth pcol indent))) + ;; parse the rest of the line + (while (and (> line-end-position (point)) + (setq state (apply 'ruby-parse-partial + line-end-position state)))) + (setq in-string (car state) + nest (nth 1 state) + depth (nth 2 state) + pcol (nth 3 state) + indent (nth 4 state)) + ;; skip heredoc section + (if (re-search-forward (concat "^" re "$") end 'move) + (forward-line 1) + (setq in-string id-end) + (goto-char end)))) (t (goto-char pnt)))) ((looking-at "^__END__$") -- cgit v1.2.3