Commit ff8c9764 authored by Dmitry Gutov's avatar Dmitry Gutov
Browse files

* lisp/progmodes/ruby-mode.el (ruby-accurate-end-of-block): When

`ruby-use-smie' is t, use `smie-forward-sexp' instead of
`ruby-parse-partial'.

Fixes: debbugs:16078
parent d64643b4
2013-12-09 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-accurate-end-of-block): When
`ruby-use-smie' is t, use `smie-forward-sexp' instead of
`ruby-parse-partial' (Bug#16078).
2013-12-09 Leo Liu <sdl.web@gmail.com> 2013-12-09 Leo Liu <sdl.web@gmail.com>
* subr.el (read-passwd): Disable show-paren-mode. (Bug#16091) * subr.el (read-passwd): Disable show-paren-mode. (Bug#16091)
......
...@@ -614,11 +614,16 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'." ...@@ -614,11 +614,16 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
(nreverse (ruby-imenu-create-index-in-block nil (point-min) nil))) (nreverse (ruby-imenu-create-index-in-block nil (point-min) nil)))
(defun ruby-accurate-end-of-block (&optional end) (defun ruby-accurate-end-of-block (&optional end)
"TODO: document." "Jump to the end of the current block or END, whichever is closer."
(let (state (let (state
(end (or end (point-max)))) (end (or end (point-max))))
(if ruby-use-smie
(save-restriction
(back-to-indentation)
(narrow-to-region (point) end)
(smie-forward-sexp))
(while (and (setq state (apply 'ruby-parse-partial end state)) (while (and (setq state (apply 'ruby-parse-partial end state))
(>= (nth 2 state) 0) (< (point) end))))) (>= (nth 2 state) 0) (< (point) end))))))
(defun ruby-mode-variables () (defun ruby-mode-variables ()
"Set up initial buffer-local variables for Ruby mode." "Set up initial buffer-local variables for Ruby mode."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment