Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I stop VScode from remembering the saved state of closed files?

Specifically, I don't want vscode to remember my cursor position or code folding in files that I've closed out of. I've looked all throughout the settings and can't seem to find it.

like image 760
Ryan Mortier Avatar asked Oct 17 '25 15:10

Ryan Mortier


1 Answers

The functionality you are looking for was added in v.1.28.0. See release notes: do not restore state.

VS Code has always remembered the view state (cursor location, folded sections, etc.) of a file even after the file was closed. There is now a new setting workbench.editor.restoreViewState to drop this view state when a file is closed. This allows you to always start at the top of the file after reopening it.

like image 55
Mark Avatar answered Oct 22 '25 01:10

Mark