Permalink
Browse files

Override ruby-end-insert-newline to t if RET is pressed

  • Loading branch information...
1 parent 71b183a commit ab84e909b39f4d800c6efcf349429509933b28aa @dgutov dgutov committed Oct 14, 2013
Showing with 13 additions and 1 deletion.
  1. +11 −0 features/ruby-end.feature
  2. +2 −1 ruby-end.el
@@ -96,6 +96,17 @@ Feature: Insert end
end
"""
+ Scenario: Always insert newline after RET
+ Given insert newline is turned off
+ When I type "foo do"
+ And I press "RET"
+ Then I should see:
+ """
+ foo do
+
+ end
+ """
+
# NOTE:
# I have to hax these two scenarios, since running Emacs in batch
# mode does not set the text properties.
View
@@ -119,7 +119,8 @@ When nil, any `last-command' will do."
(interactive)
(cond
((and ruby-end-expand-on-ret (ruby-end-expand-p))
- (ruby-end-insert-end)
+ (let ((ruby-end-insert-newline t))
+ (ruby-end-insert-end))
(forward-line 1)
(indent-according-to-mode))
(t

0 comments on commit ab84e90

Please sign in to comment.