PTVS icon indicating copy to clipboard operation
PTVS copied to clipboard

Auto commenting lines using LF or CRLF

Open cwebster-99 opened this issue 1 year ago • 1 comments

When typing a comment and Enter is pressed when there's text following the caret position, the next line is automatically commented, but these lines are inserted using CRLF, creating a mess when various IDEs that find this mix and convert it implicitly to LF or CRLF, so the entire file is changed, creating numerous merge conflicts.

Here's an example. Select LF as the line ending in the bottom right corner in the editor and place the caret as shown below and press Enter.

#    v-- place typing caret here, press Enter
# ABC <-- may be a space without this comment - same behavior
#

Observe how line endings in the bottom right corner are changed to MIXED. If there is no text following the caret, it ignores multiple levels of indentation and jumps to the first position, so in a class with methods, a ton of indentation needs to be introduced.

cwebster-99 avatar May 10 '23 19:05 cwebster-99

Ref https://github.com/microsoft/PTVS/issues/7594

cwebster-99 avatar May 10 '23 19:05 cwebster-99