Skip to content

Commit

Permalink
jedi:call-deferred: don't send line=0, it's an error for jedi
Browse files Browse the repository at this point in the history
  • Loading branch information
immerrr committed Nov 3, 2018
1 parent 251d086 commit fe07049
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jedi-core.el
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,8 @@ See: https://github.com/tkf/emacs-jedi/issues/54"
(defun jedi:call-deferred (method-name)
"Call ``Script(...).METHOD-NAME`` and return a deferred object."
(let ((source (buffer-substring-no-properties (point-min) (point-max)))
(line (count-lines (point-min) (min (1+ (point)) (point-max))))
;; line=0 is an error for jedi, but is possible for empty buffers.
(line (max 1 (count-lines (point-min) (min (1+ (point)) (point-max)))))
(column (- (point) (line-beginning-position)))
(source-path (jedi:-buffer-file-name)))
(epc:call-deferred (jedi:get-epc)
Expand Down

0 comments on commit fe07049

Please sign in to comment.