From 8a8a333dedad0fd8217c806a1ceeb9c0c2fb1d56 Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Mon, 5 Dec 2022 22:57:29 -0500 Subject: [PATCH] Put goto-line paths in the margin Moreover, get rid of funky backgrounds (such as visible marks and such) --- avy.el | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/avy.el b/avy.el index 4c94a30..ccdeb0e 100644 --- a/avy.el +++ b/avy.el @@ -1032,12 +1032,19 @@ COMPOSE-FN is a lambda that concatenates the old string at BEG with STR." `(face ,(overlay-get other-ol 'face)) old-str)) (overlay-put ol 'window wnd) (overlay-put ol 'category 'avy) - (overlay-put ol (if (eq beg eob) - 'after-string - 'display) - (funcall - (or compose-fn #'concat) - str old-str)) + ; here i should write in the margin IF I am doing at the bol + (if (eq avy-command 'avy-goto-line) + (let ((str-margin (concat " " str))) + (add-face-text-property 0 (length str-margin) `(:background ,(face-attribute 'default :background)) nil str-margin) + (overlay-put ol 'before-string + (propertize str 'display + `((margin left-margin) ,str-margin)))) + (overlay-put ol (if (eq beg eob) + 'after-string + 'display) + (funcall + (or compose-fn #'concat) + str old-str))) (push ol avy--overlays-lead))))) (defcustom avy-highlight-first nil