AddAnyFile icon indicating copy to clipboard operation
AddAnyFile copied to clipboard

Uses Spaces for Item Templates

Open SeanSobeySage opened this issue 8 years ago • 3 comments

Installed product versions

  • Visual Studio: 2015 Enterprise
  • This extension: Add New File version 3.1.88

Description

Uses Spaces when my IDE is set to use Tabs. A very minor issue but I thought worth reporting.

Steps to recreate

  1. Set IDE to use Tabs. Tools > Options > Text Editor > All Languages (or eg C#) > Tabs > Tab > Size: 4, Indent: 4, Keep Tabs: true.
  2. Insert a new file in a project, eg Test.cs
  3. Notice that it has spaces not tabs

Current behavior

Using spaces for templates always.

Expected behavior

Respect what the IDE is set to for that specific file type.

Thanks for the great extension Mads, I use it every day :)

SeanSobeySage avatar Mar 26 '16 15:03 SeanSobeySage

Might a simple solution to this problem be to trigger 'Format Document' after the new document is open? That way templates can remain the same, and you just let VS apply whatever formatting rules are currently configured. This is basically what I do manually every time. This bug, albeit minor, results in a lot of whitespace issues for tab users.

johnhargrove avatar Aug 10 '17 16:08 johnhargrove

Yeah, this behavior is very annoying. Please,

Respect what the IDE is set to for that specific file type.

anreton avatar Feb 16 '20 11:02 anreton

As a workaround, you can edit the used template files.

After installing the extension, they are located here: LocalDisk:\Users\UserName\AppData\Local\Microsoft\VisualStudio\16.0\Extensions\RandomFolderNameForAddNewFileExtension\Templates

anreton avatar Feb 19 '20 17:02 anreton