Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weird behavior when indenting code in sublime text 3

I have this code:

Route::group(['prefix' => 'somthing'], function () {
    Route::group(['middleware' => ['something']], function () {
        Route::group(['prefix' => 'somethingelse'], function () {
            Route::group(['prefix' => 'someotherthing'], function () {
                Route::get('something', ['uses' => 'SomethingController@something'); // Here color scheme doesn't show up properly
            });
        });
    });
});

In the middle there (where Route::get is called), The color scheme doesn't show up properly:

enter image description here

Anything from that point forward showing in white in default color scheme (doesn't work on other color schemes as well).

enter image description here

ST3 3114 build, 64bit. OS windows 8.1. Screenshot 2 material theme lighter.

like image 304
z3r0ck Avatar asked Aug 14 '16 16:08

z3r0ck


People also ask

How do I fix indentations in Sublime Text?

That's quite simple in Sublime. Just Ctrl+Shift+P (or Command+Shift+P on MacOS) to open the tools pallet, type reindent , and pick Indentation: Reindent Lines . It should reindent all the file you are in, just remember to save before running the command, or it may not appear.

How do I fix sublime indentation in Python?

by pressing ctrl+f12, it will reindent your file to a tab size of 4. if you want a different tab size, you just change the "value" number.

How do I align HTML code in Sublime Text 3?

One option is to type [command] + [shift] + [p] (or the equivalent) and then type 'indentation'. The top result should be 'Indendtation: Reindent Lines'. Press [enter] and it will format the document.


1 Answers

You have a syntax error on line 5 that may be affecting the highlighting:

Route::get('something', ['uses' => 'SomethingController@something');

is missing a closing square bracket ]:

Route::get('something', ['uses' => 'SomethingController@something']);

Using the Neon Color Scheme (full disclosure: I'm the author), your original code looks like this:

no closing bracket

(note the green closing parentheses ) and curly brackets }). With the offending closing square bracket added, it looks like this:

with closing bracket

You don't indicate which color scheme you're using, so I couldn't compare my results with it, but hopefully adding the missing bracket will help.

like image 134
MattDMo Avatar answered Sep 27 '22 17:09

MattDMo