Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Visual Studio 2019 remove my indents when cut-and-pasting F# code?

In Visual Studio 2019 with Microsoft Visual F# Tools 10.4 for F# 4.6, I am seeing unexpected cut-and-paste behavior. If I cut a block of F# code and then paste it somewhere else in my file, the code block is no longer indented to the same level.

enter image description here

like image 742
Wallace Kelly Avatar asked Sep 12 '19 20:09

Wallace Kelly


1 Answers

This is a feature, not a bug.

...a feature that intelligently indents pasted code based on where your cursor is.
from https://devblogs.microsoft.com/dotnet/announcing-f-4-6/

To enable or disable this feature, look at Tools > Options > Text Editor > F# > Formatting > Reformat indention on paste.

like image 189
Wallace Kelly Avatar answered Nov 09 '22 02:11

Wallace Kelly