Skip to content

Commit

Permalink
Fix ruby-send-definition
Browse files Browse the repository at this point in the history
The `ruby-end-of-defun` function doesn't work on it's own (for me at least), but is called by `end-of-defun` according to it's description:
> Move point to the end of the current defun.
> The defun begins at or after the point.  This function is called
> by `end-of-defun'.


### Test case:
```
def test
|
end
```

*Expected*: Definition is send to irb.

*Actual*: `Scan error: "Containing expression ends prematurely", 14, 14`
  • Loading branch information
Jan Path committed Apr 13, 2016
1 parent e91b349 commit 4d41000
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inf-ruby.el
Expand Up @@ -393,7 +393,7 @@ Must not contain ruby meta characters.")
"Send the current definition to the inferior Ruby process."
(interactive)
(save-excursion
(ruby-end-of-defun)
(end-of-defun)
(let ((end (point)))
(ruby-beginning-of-defun)
(ruby-send-region (point) end))))
Expand Down

0 comments on commit 4d41000

Please sign in to comment.