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

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

[elpa] externals/capf-autosuggest 200c509 50/63: Disable overlay before


From: ELPA Syncer
Subject: [elpa] externals/capf-autosuggest 200c509 50/63: Disable overlay before executing a partial accept command
Date: Wed, 27 Oct 2021 14:58:03 -0400 (EDT)

branch: externals/capf-autosuggest
commit 200c5098570528f6bef094fbf0ca0d927b82c338
Author: jakanakaevangeli <jakanakaevangeli@chiru.no>
Commit: jakanakaevangeli <jakanakaevangeli@chiru.no>

    Disable overlay before executing a partial accept command
---
 capf-autosuggest.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/capf-autosuggest.el b/capf-autosuggest.el
index 0968e6b..6dc124b 100644
--- a/capf-autosuggest.el
+++ b/capf-autosuggest.el
@@ -258,12 +258,13 @@ interactively.  Afterwards, the added text is deleted, 
but only
 the portion after point.  Additionally, if point is outside of
 the added text, the whole text is deleted."
   (let (beg end text)
+    (setq beg (overlay-start capf-autosuggest--overlay))
+    (capf-autosuggest-active-mode -1)
     (with-silent-modifications
       (catch 'cancel-atomic-change
         (atomic-change-group
           (save-excursion
-            (goto-char (overlay-start capf-autosuggest--overlay))
-            (setq beg (point))
+            (goto-char beg)
             (insert-and-inherit capf-autosuggest--str)
             (setq end (point)))
           (call-interactively command)
@@ -311,10 +312,9 @@ the added text, the whole text is deleted."
 Do not call this command if variable `capf-autosuggest-active-mode' is
 inactive."
   (interactive)
-  (capf-autosuggest-call-partial-accept-cmd
-   (lambda ()
-     (interactive)
-     (goto-char (overlay-start capf-autosuggest--overlay)))))
+  (when capf-autosuggest-active-mode
+    (goto-char (overlay-start capf-autosuggest--overlay))
+    (insert-and-inherit capf-autosuggest--str)))
 
 (defun capf-autosuggest-comint-previous-matching-input-from-input (n)
   "Like `comint-previous-matching-input-from-input'.



reply via email to

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