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

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

[elpa] master 5e79f16 020/184: ivy.el (ivy--input): Fix point moving in


From: Oleh Krehel
Subject: [elpa] master 5e79f16 020/184: ivy.el (ivy--input): Fix point moving in TRAMP sessions
Date: Wed, 16 Oct 2019 13:14:41 -0400 (EDT)

branch: master
commit 5e79f162562dfbc559e2f7005feff8cf8264f2df
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    ivy.el (ivy--input): Fix point moving in TRAMP sessions
    
    If the key-by-key input from user is fast, sometimes the output from
    TRAMP comes in and moves the point, which made `ivy-text' longer than
    one line. This change should fix it.
    
    Fixes #2160
---
 ivy.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/ivy.el b/ivy.el
index 2bf0b2d..b25c0b4 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2758,9 +2758,11 @@ tries to ensure that it does not change depending on the 
number of candidates."
 (defun ivy--input ()
   "Return the current minibuffer input."
   ;; assume one-line minibuffer input
-  (buffer-substring-no-properties
-   (minibuffer-prompt-end)
-   (line-end-position)))
+  (save-excursion
+    (goto-char (minibuffer-prompt-end))
+    (buffer-substring-no-properties
+     (point)
+     (line-end-position))))
 
 (defun ivy--minibuffer-cleanup ()
   "Delete the displayed completion candidates."



reply via email to

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