William Denton <w...@pobox.com> writes:

> No and no, but now that I'm thinking about searching, I remember I use Swiper 
> (and Ivy and Counsel).ยน  C-s runs =swiper=, which is =isearch-forward= "with 
> an overview," as it 
> describes itself.
>
> If we've narrowed it down to searching, could it be connected to that?  To 
> the 
> other people with this problem: do you use Swiper?

I am looking at
https://github.com/abo-abo/swiper/blob/master/swiper.el#L980 and I note
that swiper calls `isearch-filter-predicate', but not
`isearch-mode-end-hook', which indeed explains why the isearch overlays
are not converted back to proper Org folds.

Does it help if you try the following variant of 
`org-fold-core--isearch-filter-predicate-overlays':

(defun org-fold-core--isearch-filter-predicate-overlays (beg end)
  "Return non-nil if text between BEG and END is deemed visible by isearch.
This function is intended to be used as `isearch-filter-predicate'."
  (when isearch-mode (org-fold-core--create-isearch-overlays beg end)) ;; trick 
isearch by creating overlays in place of invisible text
  (isearch-filter-visible beg end))

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to