spacemacs icon indicating copy to clipboard operation
spacemacs copied to clipboard

evil-ex-search skips matches in folded regions (in org-mode)

Open sainathadapa opened this issue 9 months ago • 5 comments

Description :octocat:

When using evil-ex-search-forward (/) in a org file, I should be able to navigate to matches in all regions and navigating to matches in folded regions should unfold the region.

Reproduction guide :beetle:

  • Start Emacs
  • Open a org file, and activate evil mode if it wasn't already
  • Collapse all sections
  • Search for a string within one of the collapsed sections

Observed behaviour: :eyes: :broken_heart: No matches found

Expected behaviour: :heart: :smile: Evil should find the word within the collapsed section, and navigate to it. (Expand the sections if necessary)

System Info :computer:

  • OS: darwin
  • Emacs: 29.1
  • Spacemacs: 0.999.0
  • Spacemacs branch: develop (rev. b86a07443)
  • Graphic display: t
  • Running in daemon: nil
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
((org :variables org-enable-bootstrap-support t org-want-todo-bindings t)
 auto-completion
 (spell-checking)
 syntax-checking deft emacs-lisp html lsp markdown git helm
 (osx :variables osx-command-as 'control osx-option-as 'meta osx-control-as 'hyper osx-function-as nil osx-right-command-as 'left osx-right-option-as 'left osx-right-control-as 'left osx-swap-option-and-command nil))
  • System configuration features: ACL GIF GLIB GMP GNUTLS IMAGEMAGICK JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM ZLIB

Backtrace :paw_prints:

N/A

sainathadapa avatar Sep 11 '23 15:09 sainathadapa

The above issue is similar to this issue I found within doomemacs repo - https://github.com/doomemacs/doomemacs/issues/6478

sainathadapa avatar Sep 11 '23 15:09 sainathadapa

I'm having the same problem.

davidpiano avatar Nov 18 '23 00:11 davidpiano

This seems to be an issue between org and evil-search as both use different methods for marking folded text.

The more modern solution for folding tests is "overlays" therefore we need to force org to use it. We can do this by setting "org-fold-core-style" to "overlays" in the org layer.

smile13241324 avatar Nov 18 '23 13:11 smile13241324

"Overlays" is less modern, not more. After reading what org gains by using its newer folding method, I'd prefer to give up evil-ex-search in return for it.

davidpiano avatar Nov 19 '23 04:11 davidpiano

Sorry my mistake. Jep then lets go the other way around.

After some more reading into the details I would also go with text properties they seem to be less demanding on the CPU when appearing in huge numbers. I hope we do not loose other features by falling back to 'Isearch' though.

smile13241324 avatar Nov 19 '23 13:11 smile13241324