eric6/QScintilla/Lexers/LexerDiff.py

changeset 6942
2602857055c5
parent 6874
5a3a39442711
child 7229
53054eb5b15a
equal deleted inserted replaced
6941:f99d60d6b59b 6942:2602857055c5
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2005 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing a Diff lexer with some additional methods.
8 """
9
10 from __future__ import unicode_literals
11
12 from PyQt5.Qsci import QsciLexerDiff
13
14 from .Lexer import Lexer
15
16
17 class LexerDiff(Lexer, QsciLexerDiff):
18 """
19 Subclass to implement some additional lexer dependant methods.
20 """
21 def __init__(self, parent=None):
22 """
23 Constructor
24
25 @param parent parent widget of this lexer
26 """
27 QsciLexerDiff.__init__(self, parent)
28 Lexer.__init__(self)
29
30 self.keywordSetDescriptions = []
31
32 def isCommentStyle(self, style):
33 """
34 Public method to check, if a style is a comment style.
35
36 @param style style to check (integer)
37 @return flag indicating a comment style (boolean)
38 """
39 return style in [LexerDiff.Comment]
40
41 def isStringStyle(self, style):
42 """
43 Public method to check, if a style is a string style.
44
45 @param style style to check (integer)
46 @return flag indicating a string style (boolean)
47 """
48 return False
49
50 def defaultKeywords(self, kwSet):
51 """
52 Public method to get the default keywords.
53
54 @param kwSet number of the keyword set (integer)
55 @return string giving the keywords (string) or None
56 """
57 return QsciLexerDiff.keywords(self, kwSet)

eric ide

mercurial