akalongman / akalongman/sublimetext-codeformatter

Space around control structure parantheses and single line opening & closing php tags

Offen
#267 2 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
772
Forks
128
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi,

First, thank you for the awesome utility, very handy and versatile.

I do have a couple of issues though:
1. The "SpaceAroundControlStructures" PHP pass has no effect inside the parantheses, is it possible to also apply it there? I couldn't find any other relevant options or passes, maybe I missed it?
e.g. "if(condition && condition2) {" => "if ( condition && condition2 ) {"
2. If i have opening and closing PHP tags on the same line, it adds a newlineafter the opening tag, but this is not desirable when inside an HTML block where I output pieces of code conditionally, e.g.

```php


Some content


Some conditional content


```

which gets transformed into:

```php


Some content


Some conditional content


```

How can I force it to keep everything on a single line?

Cheers!

Edit: Seems the second issue is due to the "SpaceAroundControlStructures" pass, perhaps I am gravely misunderstanding what these transforms mean, but space != newline.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.