#4440: [with patch, needs work] Automatic Identation
-------------------------+--------------------------------------------------
Reporter: ahupfer | Owner: ahupfer
Type: enhancement | Status: new
Priority: minor | Milestone: sage-3.2.1
Component: notebook | Resolution:
Keywords: |
-------------------------+--------------------------------------------------
Changes (by boothby):
* summary: [with patch, needs review] Automatic Identation => [with
patch, needs work] Automatic Identation
Comment:
The restriction to 4 indentation levels is decidedly strange, given that
the patch itself has a 6-deep indentation. This can be written more
elegantly:
{{{
var indenting, id, tab;
indenting = RegExp("\n( *)","g");
while(indenting.test(text[0])) {
id = indexing.lastIndex;
tab = RegExp.lastMatch.substring(1);
}
if( id == second_last_break && second_last_break != -1) {
get_cell(id).value = text[0] + tab + text[1];
set_cursor_position(cell, position + tab.length);
}
}}}
The above code hasn't been tested, but should be a good start.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4440#comment:3>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---