Sublime Forum

Why are blank lines consistently added when uploading?

#1

My blood is nearly boiling. What rocket scientist thought it a good idea to force adding blank line after blank line over and over again when saving and uploading? Who has 100 lines of code and thinks… you know, I’m a little slow so I want to expand my file to 200, 250 lines so I can scroll and scroll…? UGH!

(any help would be enormously appreciated since I cannot keep hand removing lines EVERY.SINGLE.UPLOAD. Bah.

(thank you)

0 Likes

#2

What type of file are you uploading? To where? Via what mechanism; a feature of Sublime, a plugin, or another program? Which operating system are you on? Which operating system is the system you are uploading to using?

0 Likes

#3

Title updated.

This is likely a plugin.

0 Likes

#4

Apologies for the snark. I tried to delete but, couldn’t.

I removed a lint-related plugin, and the only plugin that is used in the saving/uploading process (to the best of my knowledge) is Sublime SFTP.

Any help would be appreciated. Thanks.

0 Likes

#5

Sublime SFTP explicitly chooses not to implement text mode transfers to prevent issues like this. All transfers are performed in binary mode. You can turn on debug mode to see the commands that are being run. Perhaps there is some information you can find from the debug log that will help in determining what the issue is?

0 Likes

#6

I believe (I know it’s hard to imagine) I’m the problem in the scenario. I hadn’t properly setup my path in my sublime-project file that sits in my project root directory. I also just setup SFTP to auto upload saved files. So, when I open/edit a file in Sublime, it uploads properly. (not having this setup right meant it was effectively saving the file in my temp directory and I had (wrongly) created a key command to upload the file… which I was doing every time I made a change to a file).

I also learned the issue happens when I visit WinSCP and click a document to edit it. When I do that the extra lines are being added when it opens in Sublime 3. I know that because I downloaded the file and opened with another editor and the file is identical to what I saved.

So, the issue is resolved because I changed my process of opening/editing/saving and auto-uploading files right from the Sublime sidebar. And the problem I’m having isn’t resolved yet but, won’t happen if I don’t open files right from WinSCP into Sublime 3 (an issue I can solve another time because I don’t have much hair left :). Thanks.

0 Likes

#7

So the problem is WinSCP adding adding the blank line(s) when downloading the file?

Does this happen even in a WinSCP download that doesn’t involve opening the file directly from WinSCP in SublimeText? If you just have WinSCP copy the file from the remote to the local machine, does it add the blank line(s)?

0 Likes

#8

I ran some tests per your questions. I added UltraEdit to my editors list in WinSCP (Sublime had been the only editor I had in my WinSCP preferences up to now). The file opened properly in UltraEdit with no additional lines added.

When I change the preferences for Sublime 3 to be the default editor and opened a server html file by double-clicking the file opened in Sublime did have the extra line breaks.

When I download the file manually and open in an editor (Sublime or UltraEdit) the file is as it’s supposed to be without the extra line breaks. So, it definitely looks like WinSCP is the issue… but, only for the project done in Sublime. That is, when I open files from other websites I have via WinSCP (using Sublime as the editor) the extra line breaks are not added when I open directly.

When a file is saved in Sublime is there some (er, hidden?) code that changes the way the file is reopened in a program link WinSCP. Ugh, I’m sounding a bit off but, the symptoms point to that.

Thanks again.

0 Likes

#9

Hi guys,

Iam also using WinSCP and have the similar problem regarding blank lines, however maybe this will be helpfull:

Sublime is the only editor that I added in WinSCP. I try to open every file with it (.).

Iam opening my files (mostly HTML, CSS and PHP) directly with WinSCP.

I just selected an PHP file and clicked on “Edit”.
Sublime opens and I can see that every second line is just an empty line, so the lines have doubled!

I than closed the file, and instead of clicking “Edit” in WinSCP, I now clicked on “Open”.
Sublime opens and no empty lines are there !!

I dont know whats the different between “Edit” and “Open” function in WinSCP, but it seems that it have something todo with it?!

Hope this helps somehow!

0 Likes