microsoft / microsoft/vscode

Sticky scroll indentationModel doesn't work if no line is present after the indented block

Open
#324,412 0 comments 1 reaction 1 assignee Claimed by @aiday-mar View on GitHub
bug editor-sticky-scroll
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Does this issue occur when all extensions are disabled?: Yes

- VS Code Version: 1.127.0
- OS Version: WSL2 - Windows 11 Pro, version 25H2

Steps to Reproduce:

1. Select `indentationModel` in Sticky scroll settings (`"editor.stickyScroll.defaultModel": "indentationModel"`)
2. Create a python file with:
```python
def foo():
x = 1
```
3. Try to scroll and the first line is not sticky
Image

4. Add a line below, thus having
```python
def foo():
x = 1
# [one more line here, indented or not, without this comment]
```
5. Now the first line is sticky
Image

It can be a subtle thing, but I was having an hard time undestanding why everything inside my class didn't stick and it was annoying not knowing which function I was modifying

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.