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

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

[nongnu] elpa/inf-ruby 281c1263f9 097/265: Fix completion in Ruby 1.8.7


From: ELPA Syncer
Subject: [nongnu] elpa/inf-ruby 281c1263f9 097/265: Fix completion in Ruby 1.8.7
Date: Sat, 9 Jul 2022 21:59:17 -0400 (EDT)

branch: elpa/inf-ruby
commit 281c1263f9c8ce23cede2ba3abe11c304e23d8e0
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    Fix completion in Ruby 1.8.7
    
    Closes #42
---
 inf-ruby.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/inf-ruby.el b/inf-ruby.el
index 105bf041ef..d26c76843d 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -424,15 +424,16 @@ Then switch to the process buffer."
     (set-process-filter proc (lambda (proc string) (setq kept (concat kept 
string))))
     (unwind-protect
         (let ((completion-snippet
-               (format (concat "if defined?(Pry.config) then "
+               (format (concat "proc { |expr, line| "
+                           "if defined?(Pry.config) then "
                            "completor = Pry.config.completer"
                            ".build_completion_proc(binding, defined?(_pry_) ? 
_pry_ : Pry.new)"
                            " elsif defined?(Bond.agent) && Bond.started? then "
                            "completor = Bond.agent"
-                           " elsif 
defined?(IRB::InputCompletor::CompletionProc) then "
-                           "completor = IRB::InputCompletor::CompletionProc "
-                           "end and "
-                           "puts completor.call('%s', '%s').compact\n")
+                           " end ? (puts completor.call(expr, line).compact) : 
"
+                           "if defined?(IRB::InputCompletor::CompletionProc) 
then "
+                           "puts 
IRB::InputCompletor::CompletionProc.call(expr).compact "
+                           "end }.call('%s', '%s')\n")
                    (ruby-escape-single-quoted expr)
                    (ruby-escape-single-quoted line))))
           (process-send-string proc completion-snippet)



reply via email to

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