Atomic folded regions

Folded regions around the cursor seem to be unfolded, if my understanding of this code is right. Would it be possible to make them atomic? So if the cursor is inside them, it is moved either to the left or right instead, and folded ranges can only be explicitly unfolded by clicking or pressing some key.

I’ve read the docs but have never implemented an extension, so would appreciate some pointers on how to do this.

It seems that just providing the result of foldedRanges as atomic ranges does what you are asking for.

1 Like

Thank you! That works great.

It seems the vim extension doesn’t respect atomic regions and causes unfolding, but I’ll fix/work around that separately.