Gutter plugin for GitHub-like code hiding

Hello,
I’m trying to achieve hiding parts of a source code file, similar to GitHub diff view with a possibility to expand the visible parts of the file (load more lines both upwards and downwards) by clicking the button in the gutter:

I feel like this is different to code folding so I can’t reuse that feature for this purpose.

I’m not sure how to start, is there an existing solution I could use to kick-off my implementation? What is the general approach I should use?

Thank you very much.

Replacing decorations can be used to hide part of the document.

1 Like