nvim-orgmode/orgmode

Make Virtual Indentation (indent mode) support `set wrap`

Closed this issue · 2 comments

Does this feature exist in Emacs orgmode core?

Yes

Orgmode link

Orgmode supports this natively in https://orgmode.org/manual/Org-Indent-Mode.html

This is somewhat of a bug in Neovim.

Feature value

No response

Additional context

When using set wrap and virtual indentation. Lines that wrap do not get virtual indentation.

I am creating this issue to track resolving this. I intend to work on this issue and PR a solution if feasible.

Some things taken from my todos:

  • Needs to support wrapmragin
  • Needs to support changing conceallevel
  • Should react to cursor movement, see :h events, CursorMoved & CursorMovedI
    • When the cursor is moved over a line with conceals when conceallevel > 1, the conceals "unhide" themselves and extend the line length.
      • This also means that if the line's effective length is much larger than its concealed length, it will cause more wrapping to occur which may change the wraps of lines below (something to investigate)

Unfortunately this is kinda attached to anticonceal in Neovim.

I have some thoughts around bypassing that though, hence why I opened the issue.

After investigating more thoroughly, this is doable. I got a basic PoC working locally. The issue is performance with this is incredibly poor and still buggy. I am working on something upstream for Neovim for extmarks to better handle wraps. I'd rather invest time there and revisist this once I have some more work done in core Neovim.

Closing this because it's not exactly viable without creating all sorts of issues 😭