vscode-gitignore icon indicating copy to clipboard operation
vscode-gitignore copied to clipboard

fix: dont add new line if empty

Open SethFalco opened this issue 3 years ago • 2 comments

If a .gitignore file does exist, it adds a new line to the file even if the file is empty.

This checks the length of the file first, and will only append the initial new line if there was actually any content in the .gitignore file in the first place.

This way, if the extension is used to append content to an empty file, it won't leave a blank line on line 1.

SethFalco avatar Jul 12 '21 21:07 SethFalco

Resolved merge conflicts and updated to suit the new structure. Have all tests passing and this works is working for me in my local build.

SethFalco avatar Jul 22 '22 13:07 SethFalco

Rebased with master and fixed merge conflicts.

SethFalco avatar Aug 30 '23 20:08 SethFalco