Search code examples
visual-studio-codefolding

How to keep VSCode code-folding on copied file?


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.


Solution

  • 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...)