How to keep VSCode code-folding on copied file?

168 Views Asked by At

I'd like to duplicate a file so that the code folding is also duplicated. Tried copying the file from within VSCode, and copying and pasting the folded code itself. The latter seems to be documented in the GitHub issue 16082.

Does anyone know of a workaround?

Many thanks.

1

There are 1 best solutions below

0
On BEST ANSWER

Wow. Answer was so simple, maybe I should delete the question...

Instead of copying the file, save the original file as a new one. (Ctrl + Shift + S) or (File → Save As...)