Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

fix(folding): optimize fold/unfold all #223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wjdwndud0114
Copy link

@wjdwndud0114 wjdwndud0114 commented May 22, 2023

The previous recursive function repeatedly calls _update_lines() which is expensive. This makes my nvim freeze up even when working with smaller files; it's a terrible experience with larger files with a lot of symbol.

Changed it to an iterative algorithm and calling _update_lines() once at the end after the nodes have been updated. It should help with the memory usage too since the previous recursion wasn't tail call optimized.

fixes #224

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Very slow fold all, unfold all operations
1 participant