Home Download Buy Blog Forum Support

Indenting to Proper Level on New Line

Indenting to Proper Level on New Line

Postby andymccurdy on Sat Jan 29, 2011 2:27 am

Hi,

This isn't necessarily a plugin question, but this still seems like the most appropriate forum. I've noticed some languages, like Python, include rules for automatically indenting to the proper level when adding a newline. For example:

Code: Select all
def foo():<press enter>
    | # <-- cursor automatically indented to |


I've skimmed the Python.tmLanguage file, assuming that's where rules like this are defined, but haven't had any luck figuring out exactly what's doing this. I'd like to implement similar smart indentation to HTML, so that when someone types <div> followed by a newline, the cursor is positioned one level beyond the "<".

Any help would be appreciated. Thanks!

-andy
andymccurdy
 
Posts: 9
Joined: Sat Jan 29, 2011 2:14 am

Re: Indenting to Proper Level on New Line

Postby jps on Sat Jan 29, 2011 8:38 am

In Pythons case, these settings are controlled by Packages/Python/Miscellaneous.tmPreferences
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm


Return to Plugin Development

Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests