microsoft / microsoft/monaco-editor

FR: Code folding changed event

Open
#1,218 4 comments 3 reactions 1 assignee View on GitHub

@aeschli is already working on this.

Since Feb 24, 2023.

editor-api feature-request
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

monaco-editor version: 0.15.6
Browser: Any
OS: Any

Steps or JS usage snippet reproducing the issue:
Fold some code.

Actual behavior:
No event is fired informing me that a block of code has been folded.

Desired behavior:
I'd like an event telling me a block of code has been folded.

Maybe monaco.editor.IStandaloneCodeEditor.onDidCodeFold or something.

Use case:
I'm implementing the work-around described here: https://github.com/Microsoft/monaco-editor/issues/103 and I'd like to be able to trigger resizing the editor when code is folded as well.

Current work around I'm using:
You can detect many of the code folding events by listening to onMouseUp. This obviously has lots of false-positives though.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.