1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-05 19:31:02 -08:00

Strip trailing whitespaces at the end of converted do block

* lisp/progmodes/ruby-mode.el (ruby-brace-to-do-end):
Strip trailing whitespaces at the end of converted do block
(bug#36756).

https://bugs.ruby-lang.org/issues/16014
https://github.com/syl20bnr/spacemacs/issues/12548
This commit is contained in:
Nobuyoshi Nakada 2019-07-22 10:14:01 +09:00 committed by Dmitry Gutov
parent a112547f91
commit 0cbdbac2bb
2 changed files with 7 additions and 2 deletions

View file

@ -1690,7 +1690,8 @@ See `add-log-current-defun-function'."
(when (eq (char-before) ?\})
(delete-char -1)
(when (save-excursion
(skip-chars-backward " \t")
(let ((n (skip-chars-backward " \t")))
(if (< n 0) (delete-char (- n))))
(not (bolp)))
(insert "\n"))
(insert "end")