[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f28d238 46/78: Fix for combined org-indent-mode and visual
From: |
Oleh Krehel |
Subject: |
[elpa] master f28d238 46/78: Fix for combined org-indent-mode and visual-line-mode |
Date: |
Sat, 23 Jan 2016 14:00:02 +0000 |
branch: master
commit f28d238e0eccf9bda74b7c8691852d137839f06a
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
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
---
avy.el | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/avy.el b/avy.el
index f47d882..121630d 100644
--- a/avy.el
+++ b/avy.el
@@ -93,7 +93,7 @@ Use `avy-styles-alist' to customize this per-command."
(const :tag "Post" post)
(const :tag "De Bruijn" de-bruijn)))
-(defcustom avy-styles-alist nil
+(defcustom avy-styles-alist '((avy-goto-line . pre))
"Alist of avy-jump commands to the style for each command.
If the commands isn't on the list, `avy-style' is used."
:type '(alist
@@ -619,10 +619,16 @@ When GROUP is non-nil, (BEG . END) should delimit that
regex group."
(let* ((pt (+ pt avy--overlay-offset))
(ol (make-overlay pt (1+ pt) (window-buffer wnd)))
(old-str (with-selected-window wnd
- (buffer-substring pt (1+ pt)))))
+ (buffer-substring pt (1+ pt))))
+ (os-line-prefix (get-text-property 0 'line-prefix old-str))
+ (os-wrap-prefix (get-text-property 0 'wrap-prefix old-str)))
(when avy-background
(setq old-str (propertize
old-str 'face 'avy-background-face)))
+ (when os-line-prefix
+ (add-text-properties 0 1 `(line-prefix ,os-line-prefix) str))
+ (when os-wrap-prefix
+ (add-text-properties 0 1 `(wrap-prefix ,os-wrap-prefix) str))
(overlay-put ol 'window wnd)
(overlay-put ol 'display (concat str old-str))
(push ol avy--overlays-lead))))
@@ -976,8 +982,9 @@ Narrow the scope to BEG END."
(point))
(selected-window)) candidates))
(if visual-line-mode
- (ignore-errors
- (line-move 1))
+ (progn
+ (setq temporary-goal-column 0)
+ (line-move-visual 1 t))
(forward-line 1)))))))
(setq avy-action #'identity)
(avy--process (nreverse candidates) (avy--style-fn avy-style))))
- [elpa] master c879498 38/78: New commands avy-goto-line-above and avy-goto-line-below, (continued)
- [elpa] master c879498 38/78: New commands avy-goto-line-above and avy-goto-line-below, Oleh Krehel, 2016/01/23
- [elpa] master 248bff0 37/78: avy.el (avy--regex-candidates): Simplify, Oleh Krehel, 2016/01/23
- [elpa] master d439b9d 34/78: avy.el (avy--overlay-at-full): Avoid negative length, Oleh Krehel, 2016/01/23
- [elpa] master 70bd6ce 36/78: Search only in the visible region, Oleh Krehel, 2016/01/23
- [elpa] master f7ddd4b 39/78: Fix jumping to the last char of a folded Org outline, Oleh Krehel, 2016/01/23
- [elpa] master 528125e 40/78: avy.el (avy--process): Add window to candidates if not present, Oleh Krehel, 2016/01/23
- [elpa] master df181f1 44/78: avy.el (avy--read-candidates): Use avy-window-list, Oleh Krehel, 2016/01/23
- [elpa] master 964664c 45/78: Fix jumping to the last char of a folded Org outline, Oleh Krehel, 2016/01/23
- [elpa] master 0a18a45 43/78: avy.el (avy--read-candidates): Fix reverse order, Oleh Krehel, 2016/01/23
- [elpa] master 513c429 41/78: Make avy-goto-char-timer faster for org-mode, Oleh Krehel, 2016/01/23
- [elpa] master f28d238 46/78: Fix for combined org-indent-mode and visual-line-mode,
Oleh Krehel <=
- [elpa] master 2313410 42/78: Optimize avy-goto-char-timer, Oleh Krehel, 2016/01/23
- [elpa] master 0166808 47/78: Beep when there are no matches, Oleh Krehel, 2016/01/23
- [elpa] master 2d07a49 50/78: Make avy--overlay-at use avy--overlay, Oleh Krehel, 2016/01/23
- [elpa] master cf36a59 48/78: avy.el (avy--old-str): New defun., Oleh Krehel, 2016/01/23
- [elpa] master 3257d81 49/78: Add avy-candidate-* helper functions, Oleh Krehel, 2016/01/23
- [elpa] master 13377d9 51/78: avy.el (avy--update-offset-and-str): Split from avy--overlay-at-full, Oleh Krehel, 2016/01/23
- [elpa] master d4b693f 52/78: avy.el (avy--overlay): Take BEG END, instead of only BEG, Oleh Krehel, 2016/01/23
- [elpa] master 567570a 54/78: Fix 'at-full moving text when visual-line-mode is on, Oleh Krehel, 2016/01/23
- [elpa] master 0756c0b 53/78: avy.el (avy--overlay-at-full): Use avy--overlay, Oleh Krehel, 2016/01/23
- [elpa] master 1b78fb0 57/78: Improve the faces for the last change, Oleh Krehel, 2016/01/23