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

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

[elpa] master 7684455 15/54: counsel.el (counsel--py-action): Work with


From: Oleh Krehel
Subject: [elpa] master 7684455 15/54: counsel.el (counsel--py-action): Work with "C-M-n"
Date: Tue, 29 Sep 2015 14:09:51 +0000

branch: master
commit 76844553d42f8020e218c1f18a227e1d25bb25e7
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    counsel.el (counsel--py-action): Work with "C-M-n"
    
    * counsel.el (counsel--py-action): Include the inserted parens in to
      bounds, so that "C-M-n", "C-M-p" and `ivy-resume' work.
---
 counsel.el |   27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/counsel.el b/counsel.el
index 022eca4..a7c0471 100644
--- a/counsel.el
+++ b/counsel.el
@@ -116,18 +116,21 @@
 (defun counsel--py-action (symbol)
   "Insert SYMBOL, erasing the previous one."
   (when (stringp symbol)
-    (when counsel-completion-beg
-      (delete-region
-       counsel-completion-beg
-       counsel-completion-end))
-    (setq counsel-completion-beg
-          (move-marker (make-marker) (point)))
-    (insert symbol)
-    (setq counsel-completion-end
-          (move-marker (make-marker) (point)))
-    (when (equal (get-text-property 0 'symbol symbol) "f")
-      (insert "()")
-      (backward-char 1))))
+    (with-ivy-window
+      (when counsel-completion-beg
+        (delete-region
+         counsel-completion-beg
+         counsel-completion-end))
+      (setq counsel-completion-beg
+            (move-marker (make-marker) (point)))
+      (insert symbol)
+      (setq counsel-completion-end
+            (move-marker (make-marker) (point)))
+      (when (equal (get-text-property 0 'symbol symbol) "f")
+        (insert "()")
+        (setq counsel-completion-end
+              (move-marker (make-marker) (point)))
+        (backward-char 1)))))
 
 (defvar counsel-describe-map
   (let ((map (make-sparse-keymap)))



reply via email to

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