зеркало из https://github.com/github/ruby.git
* misc/ruby-mode.el (ruby-move-to-block): move to opening of
block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
3e2a0184d0
Коммит
764c486b84
|
@ -1,3 +1,8 @@
|
|||
Wed Mar 30 22:54:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* misc/ruby-mode.el (ruby-move-to-block): move to opening of
|
||||
block.
|
||||
|
||||
Wed Mar 30 14:35:15 2011 Shugo Maeda <shugo@ruby-lang.org>
|
||||
|
||||
* vm_insnhelper.h (COPY_CREF): should copy
|
||||
|
|
|
@ -910,7 +910,7 @@ An end of a defun is found by moving forward from the beginning of one."
|
|||
(forward-line 1))
|
||||
|
||||
(defun ruby-move-to-block (n)
|
||||
(let (start pos done down)
|
||||
(let (start pos done down (orig (point)))
|
||||
(setq start (ruby-calculate-indent))
|
||||
(setq down (looking-at (if (< n 0) ruby-block-end-re
|
||||
(concat "\\<\\(" ruby-block-beg-re "\\)\\>"))))
|
||||
|
@ -936,8 +936,18 @@ An end of a defun is found by moving forward from the beginning of one."
|
|||
(save-excursion
|
||||
(back-to-indentation)
|
||||
(if (looking-at (concat "\\<\\(" ruby-block-mid-re "\\)\\>"))
|
||||
(setq done nil))))))
|
||||
(back-to-indentation))
|
||||
(setq done nil)))))
|
||||
(back-to-indentation)
|
||||
(when (< n 0)
|
||||
(let ((eol (point-at-eol)) state next)
|
||||
(if (< orig eol) (setq eol orig))
|
||||
(setq orig (point))
|
||||
(while (and (setq next (apply 'ruby-parse-partial eol state))
|
||||
(< (point) eol))
|
||||
(setq state next))
|
||||
(when (cdaadr state)
|
||||
(goto-char (cdaadr state)))
|
||||
(backward-word)))))
|
||||
|
||||
(defun-region-command ruby-beginning-of-block (&optional arg)
|
||||
"Move backward to next beginning-of-block"
|
||||
|
|
Загрузка…
Ссылка в новой задаче