QScintilla/Editor.py

changeset 6111
d38b38117d83
parent 6105
cbd34d558bd9
child 6116
f3d3c996c193
equal deleted inserted replaced
6110:a7b096ecf963 6111:d38b38117d83
142 StartEditToken = "START_EDIT" 142 StartEditToken = "START_EDIT"
143 EndEditToken = "END_EDIT" 143 EndEditToken = "END_EDIT"
144 CancelEditToken = "CANCEL_EDIT" 144 CancelEditToken = "CANCEL_EDIT"
145 RequestSyncToken = "REQUEST_SYNC" 145 RequestSyncToken = "REQUEST_SYNC"
146 SyncToken = "SYNC" 146 SyncToken = "SYNC"
147
148 VcsConflictMarkerLineRegExpList = (
149 r"""^<<<<<<< .*?$""",
150 r"""^\|\|\|\|\|\|\| .*?$""",
151 r"""^=======.*?$""",
152 r"""^>>>>>>> .*?$""",
153 )
154
147 155
148 def __init__(self, dbs, fn="", vm=None, 156 def __init__(self, dbs, fn="", vm=None,
149 filetype="", editor=None, tv=None): 157 filetype="", editor=None, tv=None):
150 """ 158 """
151 Constructor 159 Constructor
6103 self, 6111 self,
6104 self.tr("Syntax Error"), 6112 self.tr("Syntax Error"),
6105 self.tr("No syntax error message available.")) 6113 self.tr("No syntax error message available."))
6106 6114
6107 ########################################################################### 6115 ###########################################################################
6116 ## VCS conflict marker handling methods below
6117 ###########################################################################
6118
6119 def getVcsConflictMarkerLines(self):
6120 """
6121 Public method to determine the lines containing a VCS conflict marker.
6122
6123 @return list of line numbers containg a VCS conflict marker
6124 @rtype list of int
6125 """
6126 conflictMarkerLines = []
6127
6128 for searchRe in Editor.VcsConflictMarkerLineRegExpList:
6129 ok = self.findFirstTarget(searchRe, True, False, False, 0, 0)
6130 while ok:
6131 spos = self.getFoundTarget()[0]
6132 line = self.lineIndexFromPosition(spos)[0]
6133 conflictMarkerLines.append(line)
6134
6135 ok = self.findNextTarget()
6136
6137 return conflictMarkerLines
6138
6139 ###########################################################################
6108 ## Warning handling methods below 6140 ## Warning handling methods below
6109 ########################################################################### 6141 ###########################################################################
6110 6142
6111 def toggleWarning( 6143 def toggleWarning(
6112 self, line, col, warning, msg="", warningType=WarningCode): 6144 self, line, col, warning, msg="", warningType=WarningCode):

eric ide

mercurial