def test_scintillawrapper_void_position_int(self): editor.setText('Hello world') editor.setLexer(LEXER.CONTAINER) editor.startStyling(0, 31) editor.setStyling(5, 29) styledText = editor.getStyledText(0, 5) editor.setLexer(LEXER.NULL) self.assertEqual(styledText, ('Hello', [29, 29, 29, 29, 29]))
def init_lexer(self): ''' Initializes the lexer and its properties Args: None Returns: None ''' editor.styleSetFore(self.SCE_ERR_DEFAULT, notepad.getEditorDefaultForegroundColor()) editor.styleSetFore(self.SCE_ERR_PYTHON, (255,0,0)) editor.styleSetFore(self.SCE_ERR_GCC, (255,0,0)) editor.styleSetFore(self.SCE_ERR_MS, (255,0,0)) editor.styleSetFore(self.SCE_ERR_CMD, (255,0,0)) editor.styleSetFore(self.SCE_ERR_BORLAND, (255,0,0)) editor.styleSetFore(self.SCE_ERR_PERL, (255,0,0)) editor.styleSetFore(self.SCE_ERR_NET, (255,0,0)) editor.styleSetFore(self.SCE_ERR_LUA, (255,0,0)) editor.styleSetFore(self.SCE_ERR_CTAG, (255,0,0)) editor.styleSetFore(self.SCE_ERR_DIFF_CHANGED, (255,0,0)) editor.styleSetFore(self.SCE_ERR_DIFF_ADDITION, (255,0,0)) editor.styleSetFore(self.SCE_ERR_DIFF_DELETION, (255,0,0)) editor.styleSetFore(self.SCE_ERR_DIFF_MESSAGE, (255,0,0)) editor.styleSetFore(self.SCE_ERR_PHP, (255,0,0)) editor.styleSetFore(self.SCE_ERR_ELF, (255,0,0)) editor.styleSetFore(self.SCE_ERR_IFC, (255,0,0)) editor.styleSetFore(self.SCE_ERR_IFORT, (255,0,0)) editor.styleSetFore(self.SCE_ERR_ABSF, (255,0,0)) editor.styleSetFore(self.SCE_ERR_TIDY, (255,0,0)) editor.styleSetFore(self.SCE_ERR_JAVA_STACK, (255,0,0)) editor.styleSetFore(self.SCE_ERR_VALUE, (255,0,0)) editor.styleSetFore(self.SCE_ERR_GCC_INCLUDED_FROM, (255,0,0)) editor.styleSetFore(self.SCE_ERR_ESCSEQ, (30,30,30)) editor.styleSetVisible(self.SCE_ERR_ESCSEQ, self.show_escape_chars) editor.styleSetFore(self.SCE_ERR_ESCSEQ_UNKNOWN, (255,255,120)) editor.styleSetVisible(self.SCE_ERR_ESCSEQ_UNKNOWN, self.show_escape_chars) editor.styleSetFore(self.SCE_ERR_ES_BLACK, (0,0,0)) editor.styleSetFore(self.SCE_ERR_ES_RED, (255,0,0)) editor.styleSetFore(self.SCE_ERR_ES_GREEN, (0,255,0)) editor.styleSetFore(self.SCE_ERR_ES_BROWN, (150,75,0)) editor.styleSetFore(self.SCE_ERR_ES_BLUE, (0,0,255)) editor.styleSetFore(self.SCE_ERR_ES_MAGENTA, (255,200,255)) editor.styleSetFore(self.SCE_ERR_ES_CYAN, (255,200,100)) editor.styleSetFore(self.SCE_ERR_ES_GRAY, (128,128,128)) editor.styleSetFore(self.SCE_ERR_ES_DARK_GRAY, (255,200,100)) editor.styleSetFore(self.SCE_ERR_ES_BRIGHT_RED, (170, 1, 20)) editor.styleSetFore(self.SCE_ERR_ES_BRIGHT_GREEN, (255,200,100)) editor.styleSetFore(self.SCE_ERR_ES_YELLOW, (255,255,0)) editor.styleSetFore(self.SCE_ERR_ES_BRIGHT_BLUE, (9,84,190)) editor.styleSetFore(self.SCE_ERR_ES_BRIGHT_MAGENTA, (229,8,194)) editor.styleSetFore(self.SCE_ERR_ES_BRIGHT_CYAN, (27,244,207)) editor.styleSetFore(self.SCE_ERR_ES_WHITE, (255,255,255)) editor.setLexer(10) # ordering is important editor.setProperty('lexer.errorlist.value.separate', self.separate_path_and_line_number) editor.setProperty('lexer.errorlist.escape.sequences', self.interpret_escape_sequences)
def init_scintilla(self): ''' Initialize configured styles ''' editor.setMarginWidthN(0,38) editor.setMarginWidthN(1,14) editor.setMarginWidthN(2,0) if editor.getLexer() != LEXER.CONTAINER: editor.setLexer(LEXER.CONTAINER) editor.styleSetFore(self.ERROR_STYLE, self.ERROR_STYLE_FOREGROUND) editor.styleSetFore(self.WARNING_STYLE, self.WARNING_STYLE_FOREGROUND)
def init_scintilla(self): ''' Initialize configured styles ''' editor.setMarginWidthN(0, 38) editor.setMarginWidthN(1, 14) editor.setMarginWidthN(2, 0) if editor.getLexer() != LEXER.CONTAINER: editor.setLexer(LEXER.CONTAINER) editor.styleSetFore(self.ERROR_STYLE, self.ERROR_STYLE_FOREGROUND) editor.styleSetFore(self.WARNING_STYLE, self.WARNING_STYLE_FOREGROUND)
def init_scintilla(self): ''' Initialize configured styles ''' editor.setMarginWidthN(0,38) editor.setMarginWidthN(1,14) editor.setMarginWidthN(2,0) if editor.getLexer() != LEXER.CONTAINER: editor.setLexer(LEXER.CONTAINER) editor.styleSetFore(self.ODD_COLUMN_STYLE, (54,125,198)) editor.styleSetFore(self.EVEN_COLUMN_STYLE, (87,166,74)) editor.styleSetBack(self.EVEN_COLUMN_STYLE, (0,50,20))