emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/inf-ruby 5cf94a2dd1 010/265: Fix completion string inserti


From: ELPA Syncer
Subject: [nongnu] elpa/inf-ruby 5cf94a2dd1 010/265: Fix completion string insertion so that it doesn't swallow newlines when used outside of inf-ruby buffers.
Date: Sat, 9 Jul 2022 21:59:09 -0400 (EDT)

branch: elpa/inf-ruby
commit 5cf94a2dd1504f46e7a4fd655b605e0b9ceec51d
Author: Cornelius Mika <cornelius.mika@gmail.com>
Commit: Cornelius Mika <cornelius.mika@gmail.com>

    Fix completion string insertion so that it doesn't swallow newlines when 
used outside of inf-ruby buffers.
---
 inf-ruby.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/inf-ruby.el b/inf-ruby.el
index e0f10654bb..377014052a 100755
--- a/inf-ruby.el
+++ b/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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]