How do I find the source for bugs in Sublime Text? - sublimetext3

I have been dealing with a bug in Sublime Text in js files for a while where anytime I write a comma or semi-colon, Sublime Text creates an autocomplete box with a specific number 62118. So anytime I hit enter it will autofill this useless number and I have to delete it.
More keystrokes = More anger, so I was wondering if
anyone has run into this
or if anyone might have an idea whats causing it
OR if anyone has a good general technique for finding bugs in Sublime Text
It seems to only happen in .js files but I could be wrong so help me out here please I'd love to keep the configuration I have.

There may be information in the Sublime console. To open the console go to View > Show Console (ctrl + `).
Otherwise, uninstall your plugins one by one. While it probably isn't necessary, it would be a good idea to restart Sublime each time you uninstall, to make sure any caches the plugins create are cleared.
Finally, you can simply disable autocomplete by adding the following to your User Settings.
"auto_complete": false

Related

VSCode Vim multiple cursors

I have looked everywhere and I am still unable to switch off this 'feature'!
I've been using vi and, later, vim, since the 80's and I have never had need of multiple cursors, nor can I see a use for them.
:<range>s/search/replace/ does everything I need so this new feature is infuriating beyond words, especially as I've no idea how to switch it off when it seemingly-randomly appears.
Would someone be wonderful enough as to tell me how to banish, remove, consign-to-history the multiple cursors feature in VSCode Vim 1.12.4, please?
I believe this issue is specific to the plugin. I experienced it with the HTML plugin recently, and I'm assuming you have the same problem with HTML files, but the same principle should apply to other plugins as well. You just have to find the setting.
In the VS Code settings, there is an option that reads:
HTML: Mirror Cursor On Matching Tag
You can uncheck the box there to disable the feature. Or you can go to the settings.json in your local repo (inside the .vscode directory), or the equivalent global file, and add/modify the following field like so:
"html.mirrorCursorOnMatchingTag": false
That should take care of it for you.

Run code on file open in Sublime Text

I'd like to run some code in Sublime Text every time I open a file. Is there any way of doing this?
The background, if you want more context: I recently started using Sublime Text as my main editor, and although I love having Vim mode available through the Vintageous plug-in, I just want it to be available, not forcing its way into being turned on every time I open a file.
The author does not seem open to adding an option for being turned off by default--which is entirely okay: I'm not trying to be critical of his choices, and I'm glad he's made his code available to me--so it occurred to me that Sublime Text might offer some way of running some code every time you open a file. If so, I would simply run something that sets the mode to the normal Sublime Text mode (as opposed to Vim's "normal" mode).
You can run code in response to various events by creating a plugin and subclassing sublime_plugin.EventListener. The methods you would be most interested in are on_load() and on_new(). From there, you can either run an existing command, or you can make your own in a different class (probably subclassing sublime_plugin.TextCommand).

How can I use a right to left language in "Sublime Text" editor

I want to use some strings which are in my language (Persian) in "Sublime Text", but the editor does not show them correctly, for example:
it should be:
<title>عنوان صفحه</title>
but this is how sublime is showing it:
The encoding is set to utf-8.
What should I do to fix it?
There is This Plugin But It Does Not Work Properly
https://packagecontrol.io/packages/Bidirectional%20text%20support
added by barlop
Important Note- As comments indicate, this plugin doesn't really work. People have issues copy/pasting from sublime into notepad. It's OK for viewing but that's not much of an answer.
Note, sublime with this plugin might show leters in the correct order but copy/paste in notepad and it might not so try copy/pasting in notepad first before typing a whole load in there. Also this plugin might not move the cursor in a right to left fashion. (i.e. type a letter the cursor when typing in a right to left language should move to the left)
To install,
i've tested this on ST3 portable.
if you go to the tools menu you see there's no bidirectional option
Then if you go here
https://packagecontrol.io/packages/Bidirectional%20text%20support
see it mentions
their github page here
https://github.com/praveenvijayan/Sublime-Text-2-BIDI
Click on Clone/Download then download zip
extract it and Copy the folder to the packages folder.. i.e. open sublime, do preferences..browse packages , and it gives a folder like C:\Users\harvey\Downloads\ST3\Data\Packages Paste the folder there. (maybe it's better to put it in the user subdirectory, I don't know).
Then go to the tools menu and you see bidirectional options like bidirectional text that weren't there before
And while you're at it you may want to install "package control" if it's not already installed. Go to tools..command palette.. type 'package' see if package control appears. Or go to preferences, see if there is package control listed. If not then you don't have 'package control' installed. You can install package control by going to https://packagecontrol.io/ and click install and it gives you some python code in 2 tabs, one for ST2, one for ST3, and you can paste it into your console(view..console). But it's not strictly necessary you can install the bidirectional package without doing that.
The RTL-Mirror plugin for sublime 3 will show you the correct text by hitting Ctrl+F1 on Windows and OSX and Shift+F1 on Linux. it's not the perefect solution but it helps.
For the last few years my workflow has to been use VS Code as an IDE, for coding, and Sublime Text 3 (sorry, 4) for editing plain text because of its startup speed and because VS Code would be overkill.
However, since it's pretty clear by this point that the ST devs don't intend to implement RTL support, and because I would rather not have to install a third text editor just to deal with RTL text (which there are very few of anyway), there were only two convenient options left for me to open up RTL files on Windows.
Use Windows 10's Notepad (yes, really)
This is the superior solution since the new Notepad works well, starts up faster than Sublime, and not only renders RTL text but renders it quite well. The only downside is the lack of a dark mode.
Use VS Code (or whatever your preferred IDE is)
Both free IDEs like VS Code and paid ones like PHPStorm and IntelliJ seem to support RTL out of the box, but pretty much the only good reason to do this is if you absolutely need dark mode or are not on Windows - otherwise all of them up start up far slower than Sublime, and in the case of VS Code, render RTL text worse than Notepad does (I can't speak for JetStorm IDEs on that front).
Who knows, if I find a better alternative text editor that I can move my custom theme over to I may eventually move away from Sublime completely to another editor, but until then, sticking to two editors.

Sublime Text 3 - Double Tab Issue

I am using Sublime Text 3 and every time I press tab it will add an extra tab. My settings are to display tabs as an actual tab (not spaces) and is equivalent to 4 spaces. My issue causes a single tab to therefore create 2 tabs the length of 8 spaces.
For example, if I am trying to indent it will tab twice and I will have to delete one tab.
If I select a block of text it will indent it twice and result in the text being deleted and I have to undo it once to bring the text back.
Also, when using auto complete I normally hit tab to auto complete the first option. It will select the option and do a tab after it. I am not sure if this is an option or setting but its extremely annoying and I have not found a solution yet.
Sublime Text double tabs on tab key press
Sublime Text deletes/removes text on indentation / tab
Both problems are due to a popup (most often the SFTP free version popup for me) hiding in the background. If you make sure to close the popup windows every time they appear you will not get these issues. You could also pay for Sublime or the plugin to remove the popups.
In OSX you can't focus back on Sublime Text without clicking on the popup, so you will never have these problems.
I just had the same issue. I just restarted Sublime and it worked again, no need to reinstall or change any settings.
I just encountered this problem recently, and it appears to only happen on Windows. In my case, the pop-up "Hello! would you like to purchase sublime?" was open in the background, and that caused this issue for me. Once that pop-up is closed, everything works just fine.
Although the question is three months old at the time of writing, this might help people that are still looking for an answer. After having this issue for a while, it annoyed me so much that I traced back the issue.
The double tab issue only happened after a while, so I figured it was triggered by a certain key combination, being pressed wrongly. I've also noticed that the bug only occurred at Windows, not on Linux (Ubuntu).
After disabling all Sublime Text 3 plugins one by one, I've noticed that, for me, SFTP triggered the bug. This happened upon saving, SFTP started uploading, and displayed a evaluation notice. As I've purchased SFTP (and activated it), the double tab bug never occurred again. Even after enabling all other packages, the double tab never troubled again.
This is only one solution to the problem, your problem might originate from something else. Try to disable packages which might cause the problem and try to find the problem that way. It's a lot of work, but might get you the solution.
This solution worked for me on windows:
Just go to
View -> Layout -> Single

Package control in Sublime Text 3 no longer appearing when using keyboard shortcut

I don't know of any other way to access Package Control, but i find it weird that it doesn't work anymore, could the installation of other packages have caused it to just stop working? I don't even know how to debug something like this or find a solution for it, it appears this doesn't happen to many people, but it surely is happening to me.
When i press cmd+shift+p i don't get the Package control window. My ST3 has been very buggy and no updates have ever been available.
Is there just a quick way to wipe it all clean and start over?
Thanks.
If you want to completely start from scratch, first exit Sublime, then delete /Applications/Sublime Text.app. Finally, delete ~/Library/Application Support/Sublime Text 3.
You can now re-download ST3 and reinstall Package Control. Restart Sublime as instructed, and you should now be able to hit ⌘ShiftP and open the Command Palette. Type in packcon to get the Package Control options. You'll need to reinstall all your plugins, and reset any custom preferences, keybindings, snippets, etc. you've made.
Good luck!

Resources