Auto Indentation for Python
Here’s my preliminary idea for the auto indentation for Python in Anjuta.
/* When a new line character is inserted (user pressed Return after a line),
* the following pseudo code could be executed. Here currentline is
* the line number of the present line (after which the new line is
* supposed to begin.
* Assumption: Ignoring multilines for now.
*/
if (there is a colon at the end of currentline)
{
line_indent = get_indentation (currentline) + INDENT_SIZE;
}
else
{
line = currentline;
while (line is a blank or spaces-only line)
line–;
line_indent = get_indentation (line);
}
return line_indent;
I am thinking of coding this approach, testing and improving. I know this is too naive, but I just want to start with something. The multilines and other special cases that follow thereafter would provide for further tweaking. This whole project seems like a nice TopCoder Marathon Match, where the first submission is always a naive solution, and things improve over successive submissions. Would be nice to follow the “commit early, commit often” theory during this GSoC
Navigation
User login
Drill down
Click a term to initiate a search.
Content type
- User Profile (153)
- Mentoring Organization (152)
- Student Project (69)
Mentoring Organization
- Drupal (20)
- KDE (13)
- The Apertium Project (12)
- GNOME (12)
- Python Software Foundation (10)
- GenMAPP (8)
- Mono Project (7)
- The Honeynet Project (5)
- Maemo Community (5)
- The Apache Software Foundation (4)
- more...
SoC Status
- Student (134)
- Mentor (12)
- Organization official (7)
