Tampermonkey / tampermonkey

Tampermonkey is the most popular userscript manager, with over 10 million users. It's available for Chrome, Microsoft Edge, Safari, Opera Next, and Firefox.
GNU General Public License v3.0
4.18k stars 417 forks source link

Do-While auto indent issue #1642

Open LN-24111 opened 1 year ago

LN-24111 commented 1 year ago

Indentation breaks when using do-while loop. Sample code given below in expected/actual behavior

Expected Behavior

(function() {
    'use strict';
    if (true){
        if (true){
            do {
            }
            while (true)
        }
    }
})();

Actual Behavior

(function() {
    'use strict';
    if (true){
        if (true){
            do {
            }
            while (true)
        }
        }
    })();

Specifications

derjanb commented 1 year ago

I just created a new extension that allows to edit the userscripts of Tampermonkey at vscode.dev (which is basically a VSCode online editor).

I know this does not fix Tampermonkey's internal editor, but it might help. To test it you have to install TM BETA 4.19.6176+ and Tampermonkey Editors 1.0.1.

A click at "Tampermonkey Editors"' icon will take you to vscode.dev and a "folder" with all installed Tampermonkey scripts should be automatically opened.