Skip to content

Commit

Permalink
Improve TAB completion
Browse files Browse the repository at this point in the history
  • Loading branch information
abicky committed Jun 1, 2014
1 parent 0697315 commit 06b6e3b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
inf-ruby-autoloads.el
*.elc
*~
8 changes: 5 additions & 3 deletions inf-ruby.el
Expand Up @@ -520,9 +520,11 @@ Returns the selected completion or nil."
Uses the first one available of Pry, Bond and the default IRB
completion."
(interactive)
(let ((replacement (inf-ruby-completion-at-point)))
(when replacement
(inf-ruby-complete-replace-expr replacement))))
(when (comint-after-pmark-p)
(let* ((bounds (inf-ruby-completion-bounds-of-expr-at-point))
(expr (buffer-substring (car bounds) (cdr bounds)))
(completions (inf-ruby-completions expr)))
(completion-in-region (car bounds) (cdr bounds) completions))))

(defun inf-ruby-complete-replace-expr (str)
"Replace expression at point with STR."
Expand Down

0 comments on commit 06b6e3b

Please sign in to comment.