Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix completion string insertion so that it doesn't swallow newlines w…

…hen used outside of inf-ruby buffers.
  • Loading branch information...
commit 5cf94a2dd1504f46e7a4fd655b605e0b9ceec51d 1 parent 13c0040
@nonsequitur authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 inf-ruby.el
5 inf-ruby.el
@@ -346,7 +346,7 @@ Then switch to the process buffer."
(defun inf-ruby-completion-at-point ()
(if inf-ruby-at-top-level-prompt-p
- (let* ((curr (thing-at-point 'line))
+ (let* ((curr (replace-regexp-in-string "\n$" "" (thing-at-point 'line)))
(completions (inf-ruby-completions curr)))
(case (length completions)
(0 nil)
@@ -361,8 +361,7 @@ Then switch to the process buffer."
Module used by readline when running irb through a terminal"
(interactive (list (inf-ruby-completion-at-point)))
(when command
- (move-beginning-of-line 1)
- (kill-line 1)
+ (kill-whole-line 0)
(insert command)))
(defun inf-ruby-complete-or-tab (&optional command)
Please sign in to comment.
Something went wrong with that request. Please try again.