Markdown editor loses scroll position when switching tabs
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
# Type: Bug
## Description
While editing a long Markdown (`.md`) document and switching between it and source code files (such as `.py`), the Markdown editor does not preserve its scroll position.
Simply switching tabs causes the Markdown document to scroll to a different location. This behavior makes editing large documentation files difficult because the current reading/editing position is lost.
The issue occurs regardless of whether the Markdown Preview is open.
The problem does **not** occur with source code editors. Switching between source code files preserves the scroll position correctly. The Markdown editor should behave the same way.
## Steps to Reproduce
1. Open a long Markdown (`.md`) file.
2. Scroll somewhere in the middle of the document.
3. Open a source code file (for example, a Python `.py` file).
4. Switch back to the Markdown tab.
## Expected Behavior
The Markdown editor should preserve its exact scroll position when switching between editor tabs.
## Actual Behavior
The Markdown editor scrolls to a different position after switching tabs. The amount and direction of the scroll appear inconsistent and unpredictable.
## Additional Information
* The issue occurs only with the Markdown editor.
* Opening or closing the Markdown Preview does not affect the behavior.
* The problem occurs during normal editor tab switching without making any changes to the document.
* The issue is most noticeable with long Markdown documentation files.
VS Code version: Code 1.132.0 (df53daabb18cd157bdb08c7f01c34df936cf12f4, 2026-08-04T15:30:20Z)
OS version: Windows_NT x64 10.0.19045
Modes:
System Info
|Item|Value|
|---|---|
|CPUs|Intel(R) Xeon(R) W-2123 CPU @ 3.60GHz (8 x 3600)|
|GPU Status|2d_canvas: enabled
GPU0: VENDOR= 0x10de, DEVICE=0x1e07 [NVIDIA GeForce RTX 2080 Ti], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=32.0.15.9144 *ACTIVE*
GPU1: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.19041.5794
Machine model name:
Machine model version:
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgpu: enabled
webnn: disabled_off|
|Load (avg)|undefined|
|Memory (System)|127.73GB (98.65GB free)|
|Process Argv|--crash-reporter-id 04e4fb0a-b13c-4d31-8fe3-e262850da13c|
|Screen Reader|no|
|VM|0%|
Extensions (7)
Name|Identifier|Author|Version
---|---|---|---
Ruff|charliermarsh.ruff|charliermarsh|2026.68.0
Blender Development|jacqueslucke.blender-development|JacquesLucke|0.0.31
Python Debugger|ms-python.debugpy|ms-python|2026.6.0
Python|ms-python.python|ms-python|2026.4.0
Pylance|ms-python.vscode-pylance|ms-python|2026.3.1
Python Environments|ms-python.vscode-python-envs|ms-python|1.36.0
YAML|redhat.vscode-yaml|redhat|1.24.0
Contributor guide
Assessment
This issue has not been assessed yet.