Problem: pressing :w, toggling priority, or any other operation that calls buffer.render() reset foldlevel = 99, causing all manually collapsed category sections to snap back open. Solution: snapshot which categories are folded (per window) before nvim_buf_set_lines destroys the fold tree, then restore them after fold options are re-applied by calling normal! zc on each previously closed header line. State persists across all render call sites within a session. |
||
|---|---|---|
| .. | ||
| pending | ||