microsoft / microsoft/monaco-editor
[Bug] stickyScroll ignores maxLineCount? Only sticks 1 line (for language less)
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
const value = /* set from `myEditor.getModel()`: */ `#id-1 {
border: 1px solid red;
#id-2 {
border: 1px solid red;
.class-1 {
border: 1px solid red;
}
#id-4 {
border: 1px solid red;
#id-5 {
border: 1px solid red;
.class-2 {
border: 1px solid red;
}
#id-6 {
border: 1px solid red;
.class-3 {
border: 1px solid red;
}
}
}
}
}
}`;
// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
value,
language: "less",
stickyScroll: {
enabled: true,
maxLineCount: 5
},
});
Reproduction Steps
Scroll down
Actual (Problematic) Behavior
It only/barely sticks 1 of the lines #id-4
Expected Behavior
Each id/class should be sticked as it does in vscode app + vscode.dev (works in both)
Additional Context
This bug was fixed earlier for language javascript? See issue #3565. Thanks for that @hediet!
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
Start with the linked Monaco Editor Playground reproduction and run the provided LESS example with stickyScroll enabled and maxLineCount set to 5. Compare the behavior with VS Code and vscode.dev, then review issue #3565 for the earlier JavaScript fix. Done means the nested IDs and classes remain sticky up to the configured line count.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100