akalongman / akalongman/sublimetext-codeformatter

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

Đang mở
#267 2 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
772
Fork
128
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.