Beispiel #1
0
 def __init__(self, tokens, text, state, revision):
     super(CodeEditorBlockUserData, self).__init__()
     self.tokens = tokens
     self.text = text
     self.state = state
     self.revision = revision
     self.indentation = textutils.white_space(text)
     self.blank = text.strip() == ""
Beispiel #2
0
 def indentation(self, cursor = None, direction = "left"):
     cursor =  cursor or self.textCursor()
     sourceText = cursor.block().text()
     if direction == "left":
         sourceText = sourceText[:cursor.columnNumber()]
     elif direction == "right":
         sourceText = sourceText[cursor.columnNumber():]
     return text.white_space(sourceText)