microsoft / microsoft/monaco-editor
[Bug] Minimap tied to end of file stops after a couple of seconds
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
Description
Reproducible in vscode.dev or in VS Code Desktop?
- Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
- Not reproducible in the monaco editor playground
Monaco Editor Playground Link
Monaco Editor Playground Code
let value = /* set from `myEditor.getModel()`: */ `
`;
const addValue = `
new line
new line
new line
new line
new line
new line
new line
new line
new line
`;
value = "";
// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
value,
language: "javascript",
automaticLayout: true,
scrollBeyondLastLine: false,
});
function setTimedInterval(callback, delay, timeout){
var id=window.setInterval(callback, delay);
window.setTimeout(function(){
window.clearInterval(id);
}, timeout);
}
setTimedInterval(()=> myEditor.getModel().setValue( value += addValue), 300, 12000);
Reproduction Steps
While the interval is adding new lines:
Wait until the new lines are beyond the view.
Take the minimap and drag the rectangle to the end of the file.
Actual (Problematic) Behavior
This will make the view attach/stick to the end, but after a couple of seconds, the view will stop to follow the end of line.
Expected Behavior
If the view is attached to the end, stay this way until the user does any action that cancel this.
Additional Context
Also, I would like to know if there is any option or config to make this "attach to end" or why its happening, didn´t find any option in the docs regarding this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the Monaco Editor Playground link with the supplied TypeScript reproduction and observe the minimap while setValue adds lines beyond the viewport. Start by tracing the editor's minimap drag and end-of-file scrolling behavior; done means that dragging the minimap view to the end keeps following appended lines until the user performs an action that cancels it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100