Sublime Forum

WARNING - Potentially Malicious Addon - It alters all open files, and saves the changes without authorization with no way to undo the changes - BEWARE - Download at own RISK - Invisible Tabs Spaces Switcher

#1

I downloaded this because it is supposed to replace SPACES with TABS… The problem is, by default it sets ALL TABS to SPACES and ON LOAD it EDITS THE FILE AND SAVES IT!!!

All of my python files are screwed… Instead of a tab being 4 spaces, as my settings state, some are 2, some are 4… some tabs are there and some are spaces… mixed indentation throughout the entire file, my entire project…

On top of this, you can’t UNDO because of how it saves… and because I restarted Sublime Text before I noticed this malicious addon infected all of my files… I have a broken neck, back and severe nerve damage - what little time I can spend on work is now going to fix this… my last backup is too many days behind…

This is so damned bad… who would save a file on load without letting the user decide - as soon as the addon is installed, it infects all of your files or the next time the sublime text app is restarted.

Please steer clear… it also damaged my column alignment - instead of it using tabs, all of them are spaces…

No wonder some of my files are MEGABYTES when they used to be 100kb… this is why I don’t use spaces and why I’d prefer files I work on to be converted to tabs and why I downloaded this addon…

Package Control link: https://packagecontrol.io/packages/Invisible%20Tabs%20Spaces%20Switcher


Why did I make this? I don't like working with spaces, but many development projects (Package Control, for example) require them—and coders working on teams often have different personal preferences. This lets you work the way you want to, without causing formatting issues online or making it harder to compare files when reviewing pull requests (GitHub will flag identical files for comparision if one has tabs and one has spaces).

When I installed it… I could see the first bit - convert spaces to tabs in a file as soon as you open it… there is no mention of saving… it says you have to save for it to convert tabs to spaces ( and the first thing I did was disable that setting although it has a bug in the menu where the default and user files are split into 2 commands instead of 1… the issues page doesn’t work at all either for the link which is why I’m posting this virus alert here.

I’m currently trying a technique to fix this by replacing tabs…

4 to 1, 3 to 1, 2 to 1… 1+space to 2, space+1 to 2… but it still leaves a lot of spaces left over… and I can’t set a macro for it without finding some mod so this is all manual for all of my damned files…

0 Likes

#2

I updated the files, removed the package, had settings off in the one user file ( default is packed, and it’s probably bugged there too ) because it just recorrupted the files I fixed ( partially ) by replacing tabs and then I went through manually… it took me a god damned hour…

This malicious addon needs to be removed from Package Control because editing ALL of my files and SAVING THOSE EDITS is malicious and uncalled for…

When it converts tabs, it only converts at the start of the line - ALL OF M Y ALIGNMENT has been convert4ed… and those are hell to revert… as I said, it took me an hour and I have physical therapy today…this is probably going to land me paralyzed in bed because I’m pushing so hard for days… I’m so pissed at the developer - I mean even looking at their core file - there are tabs and spaces loosely interchanged, and this is a PYTHON FILE, so they should’ve seen it was bugged and malicious since I have 50 files open which have all been destroyed again )…

Now I’ve used the sublime text menu to remove it, but it doesn’t seem to listen to the settings file where I disabled it completely…

0 Likes

#3

Sounds less “malicious” and more “poorly-implemented.”

Do you at least have your files in source control so that you can recover them?

4 Likes

#4

Why is there such a plugin? I thought that this is vanilla functionality with convert to tabs/spaces command and the relevant setting…

0 Likes

#5

You can instead thank the author of this plugin for two things that will happen to you (hopefully):

  1. You will switch to using spaces instead of tabs and understand why this was a strong recommendation in PEP8
  2. You’ll give yourself a favor and start using GIT instead of relying on old backups that are too many days behind.

Be positive and good luck!

4 Likes

#6

Was going to say the same thing, isn’t this bog standard functionality built into the editor?

0 Likes

#7

It is standard functionality, but it doesn’t happen automatically, which appears to be what this package is for.

I voiced my concerns regarding the design of the package when I reviewed it, but it was eventually accepted in a state unknown to me, because I did not do it. It should, however, be clear that a package as invasive as this (i.e. auto-replacing spaces with tabs and vice versa) is prone to errors in sensible situations and that by installing it you are aware of the risk.

I understand that you are frustrated by the package’s poor implementation practices, but I’m sure the intent of the author was not a malicious one.

The upstream issue is here:

3 Likes

#8

I do use git for my plugin but I do not submit changes every single change…

I also do not have a dev / public fork - I’m working on moving my plugin into stand alone ( 100% done and now I’m working on settings, etc… features and removing the code which was used to implement with CodeMap )…

I am going to be using a brand new bitbucket repo for this plugin and I am going to look at using a dev / public branch but with my limited time it’s been easier for me to manage my code on my computer updating as needed - zipping folder prior to making changes when necessary…

It may not be intentional on the part of the author, but to edit code and then save the file on load without a setting for it and without being able to undo the change is very poor… The fact that it also edits every single file which is opened is also terrible…

I could understand editing on load and resetting the flag which marks it as edited without saving the file - but to save it with no way to undo is not only poor design, it feels malicious…

And, when I disabled the plugin it still did it. could be some other issue though since the addon does have checks for it…

Also, the fact that it removes all of your alignment tabs with out any method to recover is very bad - there are other bugs I’ve discovered with expand tabs, etc… so… to use that without fully checking compatibility is poor devsmanship on the part of the developer - I wrote malicious because of all of the above reasons…

Next - Tabs are much better to use, in my opinion for Python and other languages because the depth can be controlled without adding characters to the file - the file size is HUGE with spaces and much smaller with tabs ( for 10s of thousands of lines I can end up with a file size of 100 to 250KB with tabs and with spaces it ends up being 1 to 2.5MB or so… a huge problem…

I also code with accessibility in mind… Color, vision, etc… deficits… With spaces and blurry or double-vision you could see 1 to 10 spaces for 2 to 4 spaces… With a tab its easier to figure out there is only 1 tab because you can enable an accessibility feature to highlight whitespace which shows up as a long white line when highlighted… Spaces have a single dot - this is largely confusing and irritating for people with eyesight deficits and other issues. Tabs make more sense overall…

Smaller file size, less issues with disabilities because less chars means less chance of an error… Different people have different ways of indenting some preferring 2 char size, 4 or even 8… Those with disabilities may find 8 to be the best because they’re large enough to know it’s only one - and with a single char vs 8 it leads to less chance of making a mistake… as said over and over… But, these editors come with the ability to resize tab sizes on the fly - not so for spaces. again why it makes sense for those with disabilities, those who prefer smaller file sizes, etc…

Anyway - back on topic …

I downloaded it because I wanted all files I opened for review to be converted to tabs ( WITHOUT THEM BEING SAVED UNLESS I SAVE IT ) - instead all tabs are converted to spaces whether you want it or not for ALL files whether you click on them or not… design flaws, but in my eyes it is malicious. Making a change the user doesn’t specify on files the user doesn’t click on is disgusting. Also using a function with bugs and other issues - and the fact that it will remove all tabs on a line, but the other function which is supposed to be the inverse to undo the changes doesn’t undo all of them - only for salt and maybe pepper of the line, but nothing in between…

Tabs to view makes it easier for me, especially when my eye rips because that causes a lot of issues in itself. Luckily it is rare, but still… being able to open a file and have tabs instead of spaces would’ve been fantastic but the file was saved making it impossible to make any minor changes and find the changes between the original and the one I’m reviewing ( in the event I needed to make a change, a simple undo action could’ve been done and then the change made, then refresh to reset tabs and repeat… easy with a few quick keyboard shortcuts ) without converting the clients work to my coding standards, or forcing tab usage on a client, etc…

One of my methodologies of coding - don’t force people to code the way they don’t want to or alter their coding standard for a job whether it’s adding code, editing, making a new mod, etc… If the mod is stand-alone I’ll ask if they’re ok with me using my coding standard, or if they’d prefer to make it look like their code.

If their code has no pattern to it ( makes it appear as though 50 people wrote it, super ugly, etc… ) I’ll inform them the benefits of developing and using a coding standard because then it makes the code appear as though one person or one VERY ORGANIZED and well communicated Team wrote it all…

0 Likes

#9

Do commit early and often
https://sethrobertson.github.io/GitBestPractices/

You can use as many branches as you want and, if you decide that your git history looks ugly, it’s possible to squash commits

2 Likes