[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master d63ce8f 2/7: Ensure that inserted candidates don't have re
From: |
Oleh Krehel |
Subject: |
[elpa] master d63ce8f 2/7: Ensure that inserted candidates don't have read-only property |
Date: |
Thu, 26 Mar 2015 11:30:30 +0000 |
branch: master
commit d63ce8fa96103e9f3be422d7b9d48de13fde34ea
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Ensure that inserted candidates don't have read-only property
* ivy.el (ivy-completions): Update.
Fixes #28.
The issue was that the whole text of erc buffer has (read-only t)
property. That means if I copy some of those strings and insert them
into the minibuffer, I can't delete them unless I set
`inhibit-read-only' to t. Instead, I set the read-only to nil for the
string that I insert. It doesn't affect the original buffer string.
---
ivy.el | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/ivy.el b/ivy.el
index 4d307f3..a06b50c 100644
--- a/ivy.el
+++ b/ivy.el
@@ -401,12 +401,14 @@ CANDIDATES is a list of strings."
(setq ivy--current (copy-sequence (nth index cands)))
(setf (nth index cands)
(ivy--add-face ivy--current 'ivy-current-match))
- (concat "\n" (mapconcat
- (lambda (s)
- (if (> (length s) ww)
- (concat (substring s 0 (- ww 3)) "...")
- s))
- cands "\n"))))))
+ (let ((res (concat "\n" (mapconcat
+ (lambda (s)
+ (if (> (length s) ww)
+ (concat (substring s 0 (- ww 3)) "...")
+ s))
+ cands "\n"))))
+ (put-text-property 0 (length res) 'read-only nil res)
+ res)))))
(provide 'ivy)
- [elpa] master updated (90473ac -> 0c2da66), Oleh Krehel, 2015/03/26
- [elpa] master 2ae5b9c 3/7: swiper.el (swiper-font-lock-ensure): Ignore gnus modes, Oleh Krehel, 2015/03/26
- [elpa] master abb6e0b 5/7: swiper.el (swiper-query-replace): Call only in minibuffer, Oleh Krehel, 2015/03/26
- [elpa] master 764e003 1/7: swiper.el (swiper-font-lock-ensure): Omit erc-mode, Oleh Krehel, 2015/03/26
- [elpa] master fdb0c45 4/7: Add swiper-query-replace, Oleh Krehel, 2015/03/26
- [elpa] master d63ce8f 2/7: Ensure that inserted candidates don't have read-only property,
Oleh Krehel <=
- [elpa] master 0c2da66 7/7: Merge commit 'ce516073e5e4359b88f98610bae9b157945eb8e8' from swiper, Oleh Krehel, 2015/03/26
- [elpa] master ce51607 6/7: Allow to cancel "M-q" with "C-g", Oleh Krehel, 2015/03/26