jskinner / DefaultPackages

Old bug tracker for Sublime Text's "Default Packages", e.g. bad syntax highlighting
http://web.archive.org/web/20150524043750/https://www.sublimetext.com/forum/viewtopic.php?f=2&t=12095
26 stars 2 forks source link

Auto indent mis-behave. #101

Closed FichteFoll closed 8 years ago

FichteFoll commented 9 years ago

From @ctf0 on February 6, 2015 1:21

i dont know if there is a particular setting i should enable ,or is there a plugin that do that but here is what am currently having

<ul>
    <li><a href="#"><img src="" alt=""></a></li>
</ul>

now when try to break the inline code ,it will become like

<ul>
    <li>
    <a href="#">
    <img src="" alt="">
    </a>
    </li>
</ul>

where it should be

<ul>
    <li>
        <a href="#">
            <img src="" alt="">
        </a>
    </li>
</ul>

plz note that in a multi column situation the indentation will mis-behave even further.

Copied from original issue: SublimeTextIssues/Core#669

FichteFoll commented 9 years ago

Please describe your exact actions (where you enter line breaks) and what you expect to happen instead.

Either way, this is not a core issue since I believe the regex can be fixed/adjusted for this case. If it could not, it would be a limitation of the .tmLanguage format.

ctf0 commented 9 years ago

my exact action is just go to the end of the opened tag and press enter to create new line ,and what i expect to happen is the 3rd block in the code above.

FichteFoll commented 9 years ago

That's not precice enough for me, assuming I was to implement this. I doubt you expect the above to happen from just one key press. Besides, what is "the opened tag".

ctf0 commented 9 years ago

i dont know how to explain this but try this 1- copy the first code block. 2- try to match the second block ,so after each open tag <li>, <a> <img u will press enter. 3- when u finish the prev step ,the code should look like the 3rd block.

ctf0 commented 9 years ago

Edit after more tests, this is clearly a problem related to the syntax file ,could u plz direct me to what part should i add/edit ,am currently using https://packagecontrol.io/packages/HTML5

FichteFoll commented 9 years ago

Yeah, something about the indent or dedent pattern of the syntax you are using. This likely applies to the default syntax as well (which HTML5 is based on) so the issue will remain.

ctf0 commented 9 years ago

u can close this now as its fixed ,thanx.

FichteFoll commented 9 years ago

I will leave it open for the default HTML package.

ctf0 commented 9 years ago

ah okey ,btw this problem doesn't exist in ST v2.

FichteFoll commented 8 years ago

Duplicate of #69.