Created attachment 137713 [details] screenshot SUMMARY STEPS TO REPRODUCE 1. Create a new .js file and copy this code into it: document.addEventListener('click', function(event) { if (false) console.log("whatever"); }); 2. Place the cursor at the end of the middle line, after the ";" 3. Hit the Enter key OBSERVED RESULT The new line is insanely indented, EXPECTED RESULT the new line should have the same indentation as the "if" line. Note that if you try the same outside of the addEventListener(...), it works as expected. Also, as far as I can tell, generally speaking, inside the function body auto indentation is not generally broken. Most of the time it works as expected but it breaks with the one-line "if" statement without {}s. By changing the above code to: document.addEventListener('click', function(event) { if (false) { console.log("whatever"); } }); I don't observe any weirdness in autoindentation. So, neither the anonymous function inside a function argument list alone, nor the one-line if statement without {} alone, are enough to cause unexpected behavior, but somehow the combination of the two things is. SOFTWARE/OS VERSIONS Operating System: openSUSE Tumbleweed 20210414 KDE Plasma Version: 5.21.4 KDE Frameworks Version: 5.81.0 Qt Version: 5.15.2 Kernel Version: 5.11.12-1-default OS Type: 64-bit Graphics Platform: X11 Processors: 8 × Intel® Core™ i7-1065G7 CPU @ 1.30GHz Memory: 7.3 GiB of RAM Graphics Processor: Mesa DRI Intel® Iris® Plus Graphics ADDITIONAL INFORMATION
Fixed in 5.91