]> code.delx.au - gnu-emacs-elpa/commit
counsel.el (counsel-yank-pop): Truncate during display
authorOleh Krehel <ohwoeowho@gmail.com>
Thu, 28 Jan 2016 16:37:23 +0000 (17:37 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Thu, 28 Jan 2016 16:37:23 +0000 (17:37 +0100)
commit8c2f213d911bb10c01a794eaaf0121ccb25d40ff
tree53f457e30b487a8135e2d0a080e22882ad71744c
parent5f4bc14db005ccf422fc64d8b0f9415b02f0f3d8
counsel.el (counsel-yank-pop): Truncate during display

* counsel.el (counsel-yank-pop-truncate): Remove defcustom.
(counsel-yank-pop-truncate-radius): New defcustom.
(counsel--yank-pop-truncate): New defun.
(counsel--yank-pop-format-function): New defun.

During the completion, only the context around the match will be shown.
By default, the context is +2 lines above and +2 lines below the match.
It can be adjusted with `counsel-yank-pop-truncate-radius'.
Additionally, `ivy-height' is temporarily bound to 5 during completion.
This way, the maximum minibuffer height should be 1+4*5=21 lines.

Fixes #315
counsel.el