Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in `helm-revive-visible-mark' #1355

Closed
wants to merge 1 commit into from

Conversation

seanirby
Copy link
Contributor

Begin search for candidates to mark revive from the source header string instead of (point-min)

Run the code below with and without my patch to see the difference. Repro steps in the comments.

;; Not a very useful transformer but its just for illustration purposes
(setq xfrmr (lambda (candidates source)
              (helm-get-candidates source)))

(setq source-1 (helm-build-dummy-source "Source 1"
                 :filtered-candidate-transformer (lambda (_c _s)
                                                   (list "5"))
                 :nohighlight t
                 :nomark t))

(setq source-2 (helm-build-sync-source "Source 2"
                 :candidates (mapcar 'prin1-to-string (number-sequence 0 10))
                 :filtered-candidate-transformer xfrmr))

;; Steps to Repro:
;; 1. Run sexp below
;; 2. Select all candidates
;; 3. Enter a character into the prompt
;; 4. Notice how 1 and 5 don't get revived
;; 5. 1 doesn't get revived because it matches the 1 in source-1's header and fails to enter the search loop
;; 6. 5 doesn't get revived because it matches the 5 in source-1's candidate and fails to enter the search loop

;; My PR fixes this behavior because it searches from the sources header rather than (point-min)
(let* ((my-after-update-hook (copy-sequence helm-after-update-hook)))

  (add-hook 'my-after-update-hook (lambda ()
                                          (helm-next-line)))

  (helm :sources `(,source-1 ,source-2)
        :helm-after-update-hook my-after-update-hook))

Begin search from candidates from the source header string instead of (point-min)
@thierryvolpiatto
Copy link
Member

Thanks merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants