Oleh Krehel [Thu, 18 Jun 2015 11:40:44 +0000 (13:40 +0200)]
Put the file instead of partial input on history
* ivy.el (ivy-read): When completing file names, put the whole file name
on history, not just the partial input that lead to that name.
This is important in order for `ivy--cd-maybe' to work.
Oleh Krehel [Thu, 18 Jun 2015 11:32:36 +0000 (13:32 +0200)]
"M-n", "M-p", "M-i" should switch directories when needed
* ivy.el (ivy-previous-history-element):
(ivy-next-history-element):
(ivy-switch-buffer): Call `ivy--cd-maybe'.
(ivy--cd-maybe): New defun. Check if the current input points to a
different directory than `ivy--directory'. If so, `ivy--cd' there.
Alexey Veretennikov [Wed, 17 Jun 2015 22:13:49 +0000 (00:13 +0200)]
Merge remote-tracking branch 'ztree/master'
1) Fixed bug with where the user unable to delete a file
or directory
2) Added hotkey 'H' in ztree-diff to toggle between hide/show
of the ignored files (i.e. starting with .dot)
3) Ignored files do not affect the directory status anymore.
4) Since the new hotkey is added, the version number is increased.
Oleh Krehel [Tue, 16 Jun 2015 09:42:46 +0000 (11:42 +0200)]
ivy-hydra.el: Improve for hydra not installed
* ivy-hydra.el (hydra): No error on require.
(package-installed-p): Enable recursive minibuffers.
(hydra-ivy): Use ASCII char instead of Unicode, since the char width may
cause misalignment.
Oleh Krehel [Tue, 16 Jun 2015 07:43:15 +0000 (09:43 +0200)]
swiper.el (swiper-query-replace): Don't miss the first
* swiper.el (swiper-query-replace): Since the point is always after the
matching thing in swiper, it's necessary to move it before it in order
for `perform-replace' not to skip it.
Oleh Krehel [Tue, 16 Jun 2015 07:38:49 +0000 (09:38 +0200)]
Require TRAMP in time
* ivy.el (ivy-alt-done): Require tramp before use. Store `ivy-last'
before calling `ivy-read', since each `ivy-read' overwrites
`ivy-last', and this one overwrites `counsel-find-file' action.
* avy.el (avy--overlay-at-full): Account for `overlays-in' not being
returned in the buffer order sometimes: it seems to be random order.
Instead, look at the minimum of all overlay starts that are on the
current line.
Oleh Krehel [Mon, 15 Jun 2015 13:33:46 +0000 (15:33 +0200)]
ivy.el (ivy-sort-functions-alist): Work for commands as well
* ivy.el (ivy-sort-functions-alist): Examine `this-command' in addition
to the COLLECTION arg of `completing-read'. Add `Man-goto-section' and
`org-refile' to the list, since these commands collect the candidates
in the order in which they are in the buffer => the candidates must
not be sorted. Mention this in the doc.
Oleh Krehel [Mon, 15 Jun 2015 13:30:47 +0000 (15:30 +0200)]
Fix the minibuffer being too small with enough candidates
* ivy.el (ivy--format): Fix the bug of getting the minibuffer height
less than `ivy-height' when `ivy--index' was between `ivy--length'
and (- ivy--length (/ ivy--height 2)).
Oleh Krehel [Mon, 15 Jun 2015 09:59:22 +0000 (11:59 +0200)]
Fix yank/undo bug
* ivy.el (ivy--insert-minibuffer): Bind `buffer-undo-list' later.
Previously, "C-y C-u" would result in the first char of yanked text not
being undone.
Oleh Krehel [Mon, 15 Jun 2015 08:06:24 +0000 (10:06 +0200)]
Allow to customize the initial input for all commands
* ivy.el (ivy-initial-inputs-alist): New defvar. Customize this to get
an initial input in any command.
(ivy-read): Unless INTIAL-INPUT is given, look it up in
`ivy-initial-inputs-alist' based on `this-command'.
Oleh Krehel [Fri, 12 Jun 2015 11:28:33 +0000 (13:28 +0200)]
ivy-toggle-calling: Toggle calling "RET" action for current candidate
* ivy.el (ivy-calling): New defvar.
(ivy-set-index): New defun - a setter for `ivy--index' that can call the
current action when `ivy-calling' isn't nil.
(ivy-beginning-of-buffer):
(ivy-end-of-buffer):
(ivy-scroll-up-command):
(ivy-scroll-down-command):
(ivy-next-line):
(ivy-previous-line): Use `ivy-set-index' instead of a plain `setq'.
(ivy-toggle-calling): New defun - toggle `ivy-calling'.
(ivy-call): New defun - call the current action.
(ivy-next-line-and-call): Use `ivy-call'.
(ivy-previous-line-and-call): Use `ivy-call'.
(ivy-read): Reset `ivy-calling' to nil.
To make use of this functionality, bind `ivy-toggle-calling' in
`ivy-minibuffer-map'. After this, "C-n" will behave like "C-M-n" etc.