Skip to content

Commit

Permalink
Merge pull request tkf#218 from immerrr/dot-complete-with-prefix-arg
Browse files Browse the repository at this point in the history
Fix jedi:dot-complete to work with prefix argument
  • Loading branch information
syohex committed Apr 12, 2015
2 parents 4491cf4 + ffeffac commit 38008cd
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions jedi.el
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,12 @@ in their Emacs configuration."
;; Calling `auto-complete' or `ac-update-greedy' instead of `ac-start'
;; here did not work.

(defun jedi:dot-complete ()
(defun jedi:dot-complete (nchars)
"Insert dot and complete code at point."
(interactive)
(when overwrite-mode
(delete-char 1))
(insert ".")
(unless (or (ac-cursor-on-diable-face-p)
(interactive "p")
(self-insert-command nchars)
(unless (or (/= prefix-arg 1) ;; don't complete if inserted 2+ dots
(ac-cursor-on-diable-face-p)
;; don't complete if the dot is immediately after int literal
(looking-back "\\(\\`\\|[^._[:alnum:]]\\)[0-9]+\\."))
(jedi:complete :expand nil)))
Expand All @@ -109,5 +108,4 @@ in their Emacs configuration."
jedi:mode-function #'jedi:auto-complete-mode)

(provide 'jedi)

;;; jedi-auto-complete.el ends here
;;; jedi.el ends here

0 comments on commit 38008cd

Please sign in to comment.