evil icon indicating copy to clipboard operation
evil copied to clipboard

Trouble using outline.el functions while in Visual Line mode

Open SimonGZ opened this issue 11 months ago • 3 comments

Issue type

Bug (I think)

Environment

Emacs version: 30.0.93 Operating System: MacOS 15.2 Evil version: 1.15 and latest build from source (01/13/2025) Evil installation type: Doom Emacs Graphical/Terminal: Graphical Tested in a make emacs session: Yes

Reproduction steps

  • Start Emacs (can be in make emacs)
  • Go to an org file with multiple headings
  • Trigger visual line mode (shift+V).
  • Try to use built-in outline.el functions like outline-next-visible-heading

Expected behavior

I would expect these functions to behave as they do when in regular visual mode (selecting to the next visible heading but including the whole line).

Actual behavior

Nothing happens. The function triggers but doesn't extend the selection to the next header.

Further notes

Is this intended behavior? Is there something I'm missing? I'm not sure if this is a bug or a feature request or just me not understanding something basic.

Thank you for your time!

SimonGZ avatar Jan 14 '25 01:01 SimonGZ

It's debatable whether this is a bug or not. Probably slightly is, but I think frequent org users often use https://github.com/Somelauw/evil-org-mode which I assume fixes this problem (I've never used it myself). I'm not entirely sure it's maintained, so if the problem persists after trying it, please report back here. Cheers

tomdl89 avatar Jan 14 '25 08:01 tomdl89

Unfortunately, I wasn't able to find a function in that package that helped.

Digging into this a little more and looking at the source code for outline-next-visible-heading, I've figured out that re-search-forward and search-forward work in visual mode in evil but not in visual line mode, and that seems to be the core issue.

I don't know why that doesn't work and perhaps it should be considered a bug. However isearch-forward does work in both visual modes so I'm going to see if I can make a replacement function for myself that uses that rather than the built-in outline.el functions.

Thank you for your help and please free to close this if the search-forward/re-search-forward issue isn't worthy of addressing.

SimonGZ avatar Jan 15 '25 06:01 SimonGZ

Ah, well in that case I assume this is an evil problem. I'll take a look when I get some time. Please feel free to share any fixes you come up with here.

tomdl89 avatar Jan 15 '25 08:01 tomdl89