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

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

[elpa] master 5c2425b 06/66: Work around python-shell-completion-at-poin


From: Dmitry Gutov
Subject: [elpa] master 5c2425b 06/66: Work around python-shell-completion-at-point's behavior
Date: Mon, 5 Nov 2018 18:19:12 -0500 (EST)

branch: master
commit 5c2425b9863810a395efcbc25abaa5348a7bfe23
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Work around python-shell-completion-at-point's behavior
    
    Closes #549
---
 company.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/company.el b/company.el
index a694a65..bded061 100644
--- a/company.el
+++ b/company.el
@@ -1361,10 +1361,18 @@ Keywords and function definition names are ignored."
      noccurs)))
 
 (defun company--occurrence-predicate ()
+  (defvar comint-last-prompt)
   (let ((beg (match-beginning 0))
-        (end (match-end 0)))
+        (end (match-end 0))
+        (comint-last-prompt comint-last-prompt))
     (save-excursion
       (goto-char end)
+      ;; Workaround for python-shell-completion-at-point's behavior:
+      ;; https://github.com/company-mode/company-mode/issues/759
+      ;; https://github.com/company-mode/company-mode/issues/549
+      (when (derived-mode-p 'inferior-python-mode)
+        (let ((lbp (line-beginning-position)))
+          (setq comint-last-prompt (cons lbp lbp))))
       (and (not (memq (get-text-property (1- (point)) 'face)
                       '(font-lock-function-name-face
                         font-lock-keyword-face)))



reply via email to

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