Oleh Krehel [Sat, 16 May 2015 17:31:26 +0000 (19:31 +0200)]
Customize how `avy-lead-face-0' is applied
* avy.el (avy-highlight-first): New defcustom. When non-nil, use
`avy-lead-face-0' even on terminal chars.
(avy--overlay-pre): Update.
(avy--overlay-at-full): Update.
(avy--overlay-post): Update.
Oleh Krehel [Wed, 13 May 2015 21:47:12 +0000 (23:47 +0200)]
ivy.el (ivy-partial-or-done): More predictability
* ivy.el (ivy-partial-or-done): Forward to `ivy-alt-done' only if
`ivy-partial' did nothing new, and either previous command was
`ivy-partial-or-done', or there's exactly one matching candidate.
Oleh Krehel [Wed, 13 May 2015 08:08:17 +0000 (10:08 +0200)]
Allow to recenter with "C-l" during counsel-git-grep
* counsel.el (counsel-git-grep-map): New defvar.
(counsel-git-grep-recenter): New command.
(counsel-git-grep-action): New defun.
(counsel-git-grep): Update.
Oleh Krehel [Tue, 12 May 2015 13:24:29 +0000 (15:24 +0200)]
counsel-git-grep now works with ivy-resume
* ivy.el (ivy-state): New field DYNAMIC-COLLECTION.
(ivy-resume): Update.
(ivy-read): New argument DYNAMIC-COLLECTION. When this is non-nil,
ignore collection and matchers etc, and just obtain the filtered
candidates by calling DYNAMIC-COLLECTION each time the input changes.
Oleh Krehel [Tue, 12 May 2015 12:55:18 +0000 (14:55 +0200)]
Introduce :matcher for counsel-git-grep
* ivy.el (ivy-state): Add MATCHER field.
(ivy-resume): Update.
(ivy-read): Add MATCHER argument. To make things faster, MATCHER can
reuse `ivy--old-re', but it's not required. MATCHER is a function that
takes a candidate and returns non-nil if it matches.
* counsel.el (counsel-git-grep): Use :matcher.
(counsel-git-grep-matcher): New defun. Skip the file name and line
number, then match as usual.
Oleh Krehel [Tue, 12 May 2015 10:36:18 +0000 (12:36 +0200)]
Add `avy-lead-face-1' for dimmed matched chars
* avy.el (avy-lead-face-0): Update doc.
(avy-lead-face-1): New face.
(avy-current-path): New defvar.
(avy-read): Store the current matched chars in `avy-current-path'.
(avy--overlay-pre):
(avy--overlay-post): Extend the string with the matched part. This
prevents shifting during selection, and looks nice too.
Oleh Krehel [Tue, 12 May 2015 09:17:46 +0000 (11:17 +0200)]
Fix the error switching to non-existent buffers
* ivy.el (ivy-read): Use `ivy-add-virtual-buffers'.
(ivy-buffer-list): Remove.
(ivy-add-virtual-buffers): New defun.
(ivy--switch-buffer-action): New defun, consider `ivy--current' being
zero length.
(ivy-switch-buffer): Use `ivy--switch-buffer-action'.
Oleh Krehel [Mon, 11 May 2015 19:26:23 +0000 (21:26 +0200)]
Stop 'at-full from shifting text
* avy.el (avy-read): Call DISPLAY-FN in buffer's reverse order.
(avy--overlay-at-full): When there's an avy overlay after point, shorten
the current overlay to one letter.
Oleh Krehel [Mon, 11 May 2015 16:35:50 +0000 (18:35 +0200)]
Allow to midway switch from less than 3 windows
* ace-window.el (aw-dispatch-always): New defcustom to enable the
permanent dispatch.
(aw--flip-keys): Remove defvar.
(aw-flip-keys): Remove defcustom, use `aw-dispatch-alist' instead.
(aw-dispatch-alist): New defcustom.
(aw-dispatch-default): Update.
(aw-select): Do a dispatch when `aw-dispatch-always' is non-nil.
(ace-delete-window):
(ace-swap-window):
(ace-maximize-window): Use callback-style, so that it's possible to
switch the action during the selection.
(aw--pop-window): Update for empty stack and only two windows.
Oleh Krehel [Mon, 11 May 2015 14:02:57 +0000 (16:02 +0200)]
When completing file names, defer to `minibuffer-complete' for "TAB"
* ivy.el (ivy-partial-or-done): Call `minibuffer-complete'. If the
resulting text is a valid directory, move there.
(ivy-read): Setup `minibuffer-completion-table' and
`minibuffer-completion-predicate'. This makes `minibuffer-complete'
work.
Oleh Krehel [Mon, 11 May 2015 10:42:56 +0000 (12:42 +0200)]
Allow to customize the minibuffer formatter
* ivy.el (ivy-format-function): New defvar.
(ivy-format-function-default): New defun.
(ivy-format-function-arrow): New defun, alternative for
`ivy-format-function'.
Oleh Krehel [Mon, 11 May 2015 09:55:49 +0000 (11:55 +0200)]
Allow to change window action midway
* ace-window.el (aw--done): Update.
(aw-dispatch-function): New defvar. Set this to customize the midway
switch behavior.
(aw-action): New defvar. Midway switch will change this variable.
(aw-set-mode-line): New defun.
(aw-dispatch-default): New defun. Catch a char not in `aw-keys' and
perform an action depending on it.
(aw-select): Set `aw-action' to the ACTION arg, and call it in the
end. It can be changed during the selection.
(aw-split-window-vert): New command.
(aw-split-window-horz): New command.
Oleh Krehel [Mon, 11 May 2015 09:07:07 +0000 (11:07 +0200)]
Swiper should use the :re-builder argument
* ivy.el (ivy--transform-re): Remove defun, :re-builder should be used
for this logic.
(ivy--filter): Update.
* swiper.el (swiper-avy): Use `ivy--regex'.
(swiper--init): Don't set `ivy--regex-function' - it will be set by
:re-builder.
(swiper--re-builder): New defun.
(swiper--ivy): Use :re-builder in call to `ivy-read'.
(swiper--update-input-ivy): Use `ivy--regex'.
(swiper--action): Use `ivy--regex'.
Oleh Krehel [Sat, 9 May 2015 18:50:01 +0000 (20:50 +0200)]
Allow to switch the action in the middle of ace-window
* ace-window.el (aw-select): Add an optional arg ACTION. Call it on
selected window. Set `avy-handler-function' to catch ?x and modify
ACTION into 'aw-delete-window.
(ace-select-window): Use callback-style.
Oleh Krehel [Sat, 9 May 2015 16:14:50 +0000 (18:14 +0200)]
Allow to break from `avy-goto-line' into `goto-line'
* avy.el (avy-handler-default): New defun.
(avy-handler-function): New variable. Bind this temporarily to catch bad chars.
(avy-read): Forward to `avy-handler-default'.
* avy-jump.el (avy--goto): Consider the case of 'exit symbol being
returned.
(avy-goto-line): Bind `avy-handler-function' to catch digits and call
`goto-line' in that case.
Oleh Krehel [Sat, 9 May 2015 11:38:05 +0000 (13:38 +0200)]
Update and document the style customization
* avy-jump.el (avy-style): New defcustom. Replaces `avy-goto-char-style'
and `avy-goto-word-style'.
(avy-styles-alist): New defcustom. Allows to customize the style for
each command separately.
(avy--with-avy-keys): Update.
(avy-goto-char-style): Obsolete.
(avy-goto-word-style): Obsolete.
Tassilo Horn [Fri, 8 May 2015 20:56:33 +0000 (22:56 +0200)]
Always default to avy-keys but allow for per-command overrides
Using the new `avy-keys-alist` one can override the default `avy-keys`
on a per-command basis. That's much better than hard-coding ?a-?z for
some commands and using the defaults for some others.