Package peppy :: Module fundamental :: Class StandardReturnMixin
[frames] | no frames]

Class StandardReturnMixin

object --+
         |
        StandardReturnMixin
Known Subclasses:

Mixin to indent the next line to the correct column

This mixin provides electricReturn, which operates when the return key is pressed. At a minimum it should insert the appropriate line end character (cr, crlf, or lf depending on the current state of the STC), but provides the opportunity to indent the line as well.

The default action is to simply copy the indent level of the previous line.

Instance Methods
 
findIndent(self, linenum)
Find proper indention of next line given a line number.
 
electricReturn(self)
Add a newline and indent to the proper tab level.

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

findIndent(self, linenum)

 

Find proper indention of next line given a line number.

This is designed to be overridden in subclasses. Given the current line, figure out what the indention should be for the next line.

electricReturn(self)

 

Add a newline and indent to the proper tab level.

Indent to the level of the line above.