217 Commits

Author SHA1 Message Date
Oleh Krehel
9d18bf9fc2 avy.el (avy--overlay): Fix overlays at point-max
* avy.el (avy--overlay): When an overlay is requested at `point-max',
  use 'after-string overlay property instead of 'display.

Fixes #125
2015-12-22 11:45:44 +01:00
Oleh Krehel
47035cf4ea avy.el (avy--line): Don't modify avy-action
Fixes #124
2015-12-22 09:18:02 +01:00
Aleksey Fedotov
72ecbfa220 avy.el (avy-goto-line): fix for narrowed regions
When 'avy-goto-line' is called with numbered argument, it tries to mimic
behaviour of 'goto-line'. However, if some part of text is hidden by
narrowing, 'avy-goto-line' failed to account for that.

This patch temporarily disables narrowing, jumps on line and then
restores narrowing, just like 'goto-line' does.

Fixes #122
Fixes #123
2015-12-19 15:30:47 +01:00
Oleh Krehel
b1a1953e1c Customize extra chars for avy-goto-subword-1
* avy.el (avy-subword-extra-word-chars): New defcustom.
(avy-goto-subword-0): Modify the syntax table temporarily using
`avy-subword-extra-word-chars'.

Fixes #116
2015-12-07 14:56:58 +01:00
Oleh Krehel
fa6d1e1242 avy.el (avy-copy-region): Fix for multi-buffer use
Fixes #119
2015-12-07 11:01:52 +01:00
Oleh Krehel
54074c764d avy.el (avy-all-windows-alt): New defcustom
* avy.el (avy-dowindows): Use `avy-all-windows-alt'.
(avy--regex-candidates):
(avy--read-candidates): Use `current-prefix-arg'. At some later point, it
could be passed as an argument instead.

Fixes #118
2015-12-07 10:36:01 +01:00
Oleh Krehel
a45159a8ca avy.el (avy-goto-line-above): Exclude the current line
* avy.el (avy-goto-line-below): Exclude the current line

Re #106
2015-12-03 12:53:12 +01:00
Oleh Krehel
4132dd647e avy.el (avy-goto-line-above): Work in a single window
* avy.el (avy-goto-line-above):
(avy-goto-line-below): Bind `avy-all-windows' to nil.

Re #106
2015-12-03 10:20:23 +01:00
Oleh Krehel
a0414291f1 avy.el (avy-copy-region): Obey avy-line-insert-style
Re #117
2015-12-02 09:38:18 +01:00
Oleh Krehel
54fb4d65e1 avy.el (avy-line-insert-style): Customize avy-copy-line, avy-move-line
* avy.el (avy-copy-line):
(avy-move-line): Update.

Fixes #117
2015-12-01 14:37:09 +01:00
Dale Sedivec
4a23a0d63e Fix De Bruijn "No catch for tag" error
When using avy-goto-line and typing a line number with avy-style
de-bruijn, you would get an error after entering your line number and
pressing RET:

    No catch for tag: done, exit

I believe this is because avy-read is wrapped with (catch 'done ...) but
avy-read-de-bruijn doesn't catch done.  This adds the catch to
avy-read-de-bruijn.
2015-11-15 10:37:08 -06:00
Oleh Krehel
f341c2f18f avy.el (avy--find-visible-regions): Add bounds safety
Re abo-abo/lispy#139
2015-11-14 11:17:53 +01:00
Oleh Krehel
edf1259f25 avy.el (avy--read-candidates): Use avy-dowindows
Fixes #114
2015-11-11 13:50:04 +01:00
Oleh Krehel
1b78fb0d89 Improve the faces for the last change
* avy.el (avy--overlay-at-full): Update.
2015-10-26 08:59:27 +01:00
Oleh Krehel
9ae44133ca Fix overlays at end-of-line with visual-line-mode
* avy.el (avy--overlay-at-full): Update.

Fixes #112
2015-10-26 08:56:10 +01:00
Oleh Krehel
dddce37cdd Fix 'at-full moving text for chars near end of visual line
* avy.el (avy--overlay-at-full): Update.
2015-10-25 15:18:27 +01:00
Oleh Krehel
567570af41 Fix 'at-full moving text when visual-line-mode is on
* avy.el (avy--overlay-at-full): Compute line-end-position according to
  `visual-line-mode'.
(avy--update-offset-and-str): Add one more arg.

Note that `visual-line-mode' is actually extremely slow. If you have a
lot of candidates, you'll get a perceptible slowdown.
2015-10-25 15:08:13 +01:00
Oleh Krehel
0756c0b48a avy.el (avy--overlay-at-full): Use avy--overlay
* avy.el (avy-styles-alist): Reset to nil.
(avy--overlay): Also set 'category to 'avy.
(avy--overlay-at-full): Use `avy--overlay'.

Fixes #110
2015-10-25 14:50:24 +01:00
Oleh Krehel
d4b693f274 avy.el (avy--overlay): Take BEG END, instead of only BEG
* avy.el (avy--overlay):
(avy--overlay-pre):
(avy--overlay-at):
(avy--overlay-post): Update.
Previously, END was implied to be (1+ BEG).
2015-10-25 14:29:45 +01:00
Oleh Krehel
13377d92b2 avy.el (avy--update-offset-and-str): Split from avy--overlay-at-full
* avy.el (avy--update-offset-and-str): New defun.
(avy--overlay-at-full): Update.
2015-10-25 14:17:34 +01:00
Oleh Krehel
2d07a49f7f Make avy--overlay-at use avy--overlay
* avy.el (avy--overlay): Add optional COMPOSE-FN argument.
(avy--overlay-at): Use `avy--overlay'.
2015-10-25 13:30:14 +01:00
Oleh Krehel
3257d81b4a Add avy-candidate-* helper functions
* avy.el (avy-candidate-beg):
(avy-candidate-end):
(avy-candidate-wnd): New defun.
(avy--overlay-pre):
(avy--overlay-at):
(avy--overlay-at-full):
(avy--overlay-post): Update.
2015-10-25 13:20:41 +01:00
Oleh Krehel
cf36a599f2 avy.el (avy--old-str): New defun.
* avy.el (avy--overlay):
(avy--overlay-at):
(avy--overlay-at-full): Simplify.
2015-10-25 12:40:40 +01:00
Tassilo Horn
0166808bc1 Beep when there are no matches
If avy--read-candidates doesn't find any candidates for the current
input, the user has surely made a typo.  In that case, beep at the user
to make him aware of that.
2015-10-22 15:25:13 +02:00
Oleh Krehel
f28d238e0e Fix for combined org-indent-mode and visual-line-mode
* avy.el (avy-styles-alist): Make `avy-goto-line' use the 'pre style.
(avy--overlay): Clone `line-prefix' and `wrap-prefix' text properties if
any. These are the properties that `org-indent-mode' uses.
(avy--line): Set `temporary-goal-column' to 0 - this affects
`line-move-visual'.

Fixes #110
2015-10-22 10:57:21 +02:00
Oleh Krehel
964664c9fd Fix jumping to the last char of a folded Org outline
avy.el (avy--read-candidates): For the last char in the
outline, (get-char-property (point) 'invisible) returns t, although it's
still visible.

Re #100
2015-10-22 10:26:26 +02:00
Oleh Krehel
df181f1e77 avy.el (avy--read-candidates): Use avy-window-list
Re #100
2015-10-21 20:37:55 +02:00
Oleh Krehel
0a18a45959 avy.el (avy--read-candidates): Fix reverse order
Re #100
2015-10-21 18:17:06 +02:00
Oleh Krehel
2313410bd7 Optimize avy-goto-char-timer
Previously, the candidate list would be generated twice: by
`avy--read-string-timer' and by `avy--generic-jump'.

* avy.el (avy--read-string-timer): Rename to `avy--read-candidates'.
(avy--read-candidates): Return the list of candidates instead of a
string which the candidates match.
(avy-goto-char-timer): Update.

Re #100
2015-10-21 13:37:12 +02:00
Oleh Krehel
513c42991c Make avy-goto-char-timer faster for org-mode
* avy.el (avy--read-string-timer): Use `avy--find-visible-regions'.
(avy-goto-char-timer): Make ARG work properly to negate
`avy-all-windows'.

Re #100
2015-10-21 12:44:31 +02:00
Oleh Krehel
528125e096 avy.el (avy--process): Add window to candidates if not present
`avy-read-de-bruijn' relies on the window being the cdr of each
candidate.

Fixes abo-abo/ace-link#22
2015-10-20 10:35:37 +02:00
Oleh Krehel
f7ddd4b687 Fix jumping to the last char of a folded Org outline
avy.el (avy--regex-candidates): For the last char in the outline,
(get-char-property (point) 'invisible) returns t, although it's still
visible.

Re #108
2015-10-19 16:11:40 +02:00
Oleh Krehel
c87949847d New commands avy-goto-line-above and avy-goto-line-below
* avy.el (avy--line): Add BEG, END optional args.
(avy-goto-line-above): New command.
(avy-goto-line-below): New command.

Fixes #106
2015-10-19 11:57:47 +02:00
Oleh Krehel
248bff08bb avy.el (avy--regex-candidates): Simplify
Remove the let-bound BEG and END that would shadow the function's args.
2015-10-19 10:08:26 +02:00
Yasushi SHOJI
70bd6cec70 Search only in the visible region
The current version of `avy--regex-candidates` first searches for the
given regex then skip the match if it's invisible.  This works fine with
less than a few thousand lines of buffer, however, it takes quit time if
your have tens of thousand lines hidden, say, in org file.

This patch reverse the strategy. Find all visible regions in given the
window first, then map the original search function to that list.  This
change reduced candidates search time from 10 or more seconds to instant
on my 100,000+ lines of org file.

It might be possible to have hundreds of visibility-interleaved regions
in a huge window on the 4K or 8K monitor in near the future, but this
reversed strategy should be fast enough for those system.

This fixes #108.
Fixes #109
2015-10-19 10:02:18 +02:00
Tassilo Horn
bda04b287b Properly highlight depending on avy-all-windows
Before this change, the highlighting was only performed in the selected
window even if avy-all-windows was true.  Now it's consistent with the
value of that variable.
2015-10-06 21:31:12 +02:00
Oleh Krehel
d439b9d44f avy.el (avy--overlay-at-full): Avoid negative length
Fixes #102
2015-09-22 11:51:11 +02:00
momomo5717
acdd9e8b3d Modify avy--read-string-timer 2015-09-19 19:00:39 +09:00
Tassilo Horn
22b4ff0658 Define new face avy-goto-char-timer-face for the highlights 2015-09-17 08:22:52 +02:00
Tassilo Horn
f9d7a76cd4 Improve avy-goto-char-timer.
1. Handle DEL in order to fix typos.
2. Handle RET in order to use the current input string immediately
   without waiting for another char for avy-timeout-seconds.
3. Highlight matches while reading chars.
2015-09-16 18:29:37 +02:00
Oleh Krehel
3f53a2a15e avy.el (avy-goto-line): Fix off-by-one 2015-09-11 12:24:02 +02:00
Oleh Krehel
67662efdb3 Fix indentation of defface
Re #97
2015-09-09 17:27:10 +02:00
Tassilo Horn
48aa2cd828 Improve avy-goto-char-timer so that it may read 1 or many chars
Now you can use avy-goto-char-timer and type as many chars as you want
given each char comes before avy-timeout-seconds (and the very first
char is mandatory, i.e., there is no timeout for the first one).
2015-09-09 16:51:17 +02:00
Akira Tamamori
ac162279f2 Add padding for wide-width character
Add padding for wide-width character (ex. Japanese and Chinese).
2015-09-04 10:38:10 +09:00
Oleh Krehel
b1ef1f8f8c avy.el (avy--line): Obey avy-background
Fixes #94
2015-08-24 11:11:26 +02:00
Oleh Krehel
72afecbc29 avy.el (avy-push-mark): Bring back push-mark
Fixes abo-abo/ace-window#41
2015-08-21 20:59:19 +02:00
Oleh Krehel
53decea669 avy.el (avy--line): Don't error on end of buffer
Re #91
2015-08-21 18:17:53 +02:00
Oleh Krehel
a6cfedaf5e avy.el (avy-goto-subword-0): Don't offer invisible chars
Fixes #90
2015-08-21 14:50:57 +02:00
Oleh Krehel
009c0bc1ed avy.el (avy--line): Work for visual-line-mode
Use `point' instead of `line-beginning-position'.

Fixes #91
2015-08-21 14:47:32 +02:00
Oleh Krehel
2c74d0160a avy.el (avy--generic-jump): Add beg and end optional args
* avy.el (avy-goto-char-in-line): Update.

Fixes #89
2015-08-21 14:34:07 +02:00