[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f04aec8 009/167: ivy-hydra.el: Bind "t" to toggle-truncate
From: |
Oleh Krehel |
Subject: |
[elpa] master f04aec8 009/167: ivy-hydra.el: Bind "t" to toggle-truncate-lines |
Date: |
Tue, 08 Dec 2015 10:49:35 +0000 |
branch: master
commit f04aec86cd60918d64caa6e5fd244fb12790662f
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy-hydra.el: Bind "t" to toggle-truncate-lines
* ivy.el (ivy-format-function-default): When `truncate-lines' is non-nil
don't truncate with "...".
Use "C-o t" when you complete very long lines and want to see them
whole.
Fixes #214
---
ivy-hydra.el | 9 +++++----
ivy.el | 10 ++++++----
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/ivy-hydra.el b/ivy-hydra.el
index 6ab1f9a..152812b 100644
--- a/ivy-hydra.el
+++ b/ivy-hydra.el
@@ -47,11 +47,11 @@
(defhydra hydra-ivy (:hint nil
:color pink)
"
-^^^^^^ ^Yes^ ^No^ ^Maybe^ ^Action^
+^^^^^^ ^Yes^ ^No^ ^Maybe^ ^Action^
^^^^^^^^^^^^^^---------------------------------------------------
-^ ^ _k_ ^ ^ _f_ollow _i_nsert _c_: calling %s(if ivy-calling \"on\"
\"off\") _w_/_s_: %s(ivy-action-name)
+^ ^ _k_ ^ ^ _f_ollow _i_nsert _c_: calling %s(if ivy-calling \"on\"
\"off\") _w_/_s_: %s(ivy-action-name)
_h_ ^+^ _l_ _d_one _o_ops _m_: matcher %s(if (eq ivy--regex-function
'ivy--regex-fuzzy) \"fuzzy\" \"ivy\")
-^ ^ _j_ ^ ^ _g_o ^ ^ _<_/_>_: shrink/grow window
+^ ^ _j_ ^ ^ _g_o ^ ^ _<_/_>_: shrink/grow _t_runcate:
%`truncate-lines
"
;; arrows
("h" ivy-beginning-of-buffer)
@@ -73,7 +73,8 @@ _h_ ^+^ _l_ _d_one _o_ops _m_: matcher %s(if (eq
ivy--regex-function 'i
(">" ivy-minibuffer-grow)
("<" ivy-minibuffer-shrink)
("w" ivy-prev-action)
- ("s" ivy-next-action))
+ ("s" ivy-next-action)
+ ("t" (setq truncate-lines (not truncate-lines))))
(provide 'ivy-hydra)
diff --git a/ivy.el b/ivy.el
index 25ea6c6..bf3981a 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1568,10 +1568,12 @@ This string will be inserted into the minibuffer.")
(let ((ww (- (window-width)
(if (and (boundp 'fringe-mode) (eq fringe-mode 0)) 1 0))))
(mapconcat
- (lambda (s)
- (if (> (length s) ww)
- (concat (substring s 0 (- ww 3)) "...")
- s))
+ (if truncate-lines
+ (lambda (s)
+ (if (> (length s) ww)
+ (concat (substring s 0 (- ww 3)) "...")
+ s))
+ #'identity)
cands "\n"))))
(defun ivy-format-function-arrow (cands)
- [elpa] master updated (a0561bf -> 1f3fa31), Oleh Krehel, 2015/12/08
- [elpa] master a71d5c8 001/167: ivy.el (ivy--insert-prompt): Improve truncation, Oleh Krehel, 2015/12/08
- [elpa] master e70ca07 003/167: ivy.el (ivy-call): "C-M-n" should not leave the minibuffer, Oleh Krehel, 2015/12/08
- [elpa] master 4ad797b 002/167: Improve "C-g" out of a long-running async process, Oleh Krehel, 2015/12/08
- [elpa] master 41b5850 005/167: ivy.el (ivy--regex-fuzzy): Add minibuffer highlighting, Oleh Krehel, 2015/12/08
- [elpa] master 19d2a40 004/167: Add flx sorting, Oleh Krehel, 2015/12/08
- [elpa] master 3146501 010/167: ivy.el (ivy-resume): Don't regexp-quote preselect, Oleh Krehel, 2015/12/08
- [elpa] master f04aec8 009/167: ivy-hydra.el: Bind "t" to toggle-truncate-lines,
Oleh Krehel <=
- [elpa] master 82a317c 011/167: Make swiper compatible with visual-line-mode, Oleh Krehel, 2015/12/08
- [elpa] master 45b54e3 015/167: counsel.el (counsel--gg-count): Fix for "'" in query, Oleh Krehel, 2015/12/08
- [elpa] master 6bf3239 006/167: ivy.el (ivy-yank-word): Add only one space each time, Oleh Krehel, 2015/12/08
- [elpa] master 73e5799 012/167: Fix counsel-git-grep not updating to 0 candidates, Oleh Krehel, 2015/12/08
- [elpa] master dfb41d0 016/167: Implement ivy-avy, Oleh Krehel, 2015/12/08
- [elpa] master eda091b 017/167: Customize ivy-avy and fix compile warnings, Oleh Krehel, 2015/12/08
- [elpa] master fa49a81 018/167: Fix "End of buffer" for swiper and visual-line-mode, Oleh Krehel, 2015/12/08
- [elpa] master 1714220 022/167: swiper.el (swiper-font-lock-ensure): Exclude help-mode, Oleh Krehel, 2015/12/08
- [elpa] master 6db3d54 024/167: ivy.el (ivy--insert-prompt): Use newlines instead of truncation, Oleh Krehel, 2015/12/08
- [elpa] master 1c1e6fc 008/167: ivy.el (ivy--reset-state): Less strict on :preselect, Oleh Krehel, 2015/12/08