QScintilla/Editor.py

changeset 3325
d2d6dda86d32
parent 3261
b8fee972444b
child 3327
1338767b5315
equal deleted inserted replaced
3322:d7118434250d 3325:d2d6dda86d32
2107 @return flag indicating the presence of a breakpoint (boolean) 2107 @return flag indicating the presence of a breakpoint (boolean)
2108 """ 2108 """
2109 line, _ = self.getCursorPosition() 2109 line, _ = self.getCursorPosition()
2110 return self.markersAtLine(line) & self.breakpointMask != 0 2110 return self.markersAtLine(line) & self.breakpointMask != 0
2111 2111
2112 def getBreakpointLines(self):
2113 """
2114 Public method to get the lines containing a breakpoint.
2115
2116 @return list of lines containing a breakpoint (list of integer)
2117 """
2118 lines = []
2119 line = -1
2120 while True:
2121 line = self.markerFindNext(line + 1, self.breakpointMask)
2122 if line < 0:
2123 break
2124 else:
2125 lines.append(line)
2126 return lines
2127
2112 def hasBreakpoints(self): 2128 def hasBreakpoints(self):
2113 """ 2129 """
2114 Public method to check for the presence of breakpoints. 2130 Public method to check for the presence of breakpoints.
2115 2131
2116 @return flag indicating the presence of breakpoints (boolean) 2132 @return flag indicating the presence of breakpoints (boolean)
2274 for handle in self.bookmarks: 2290 for handle in self.bookmarks:
2275 bmlist.append(self.markerLine(handle) + 1) 2291 bmlist.append(self.markerLine(handle) + 1)
2276 2292
2277 bmlist.sort() 2293 bmlist.sort()
2278 return bmlist 2294 return bmlist
2295
2296 def getBookmarkLines(self):
2297 """
2298 Public method to get the lines containing a bookmark.
2299
2300 @return list of lines containing a bookmark (list of integer)
2301 """
2302 lines = []
2303 line = -1
2304 while True:
2305 line = self.markerFindNext(line + 1, 1 << self.bookmark)
2306 if line < 0:
2307 break
2308 else:
2309 lines.append(line)
2310 return lines
2279 2311
2280 def hasBookmarks(self): 2312 def hasBookmarks(self):
2281 """ 2313 """
2282 Public method to check for the presence of bookmarks. 2314 Public method to check for the presence of bookmarks.
2283 2315
2406 printer.printRange(self) 2438 printer.printRange(self)
2407 2439
2408 ########################################################################### 2440 ###########################################################################
2409 ## Task handling methods below 2441 ## Task handling methods below
2410 ########################################################################### 2442 ###########################################################################
2411 2443
2444 def getTaskLines(self):
2445 """
2446 Public method to get the lines containing a task.
2447
2448 @return list of lines containing a task (list of integer)
2449 """
2450 lines = []
2451 line = -1
2452 while True:
2453 line = self.markerFindNext(line + 1, 1 << self.taskmarker)
2454 if line < 0:
2455 break
2456 else:
2457 lines.append(line)
2458 return lines
2459
2412 def hasTaskMarkers(self): 2460 def hasTaskMarkers(self):
2413 """ 2461 """
2414 Public method to determine, if this editor contains any task markers. 2462 Public method to determine, if this editor contains any task markers.
2415 2463
2416 @return flag indicating the presence of task markers (boolean) 2464 @return flag indicating the presence of task markers (boolean)
2605 """ 2653 """
2606 self.markerDeleteAll(self.__changeMarkerUnsaved) 2654 self.markerDeleteAll(self.__changeMarkerUnsaved)
2607 self.markerDeleteAll(self.__changeMarkerSaved) 2655 self.markerDeleteAll(self.__changeMarkerSaved)
2608 self.__hasChangeMarkers = False 2656 self.__hasChangeMarkers = False
2609 self.changeMarkersUpdated.emit(self) 2657 self.changeMarkersUpdated.emit(self)
2658
2659 def getChangeLines(self):
2660 """
2661 Public method to get the lines containing a change.
2662
2663 @return list of lines containing a change (list of integer)
2664 """
2665 lines = []
2666 line = -1
2667 while True:
2668 line = self.markerFindNext(line + 1, self.changeMarkersMask)
2669 if line < 0:
2670 break
2671 else:
2672 lines.append(line)
2673 return lines
2610 2674
2611 def hasChangeMarkers(self): 2675 def hasChangeMarkers(self):
2612 """ 2676 """
2613 Public method to determine, if this editor contains any change markers. 2677 Public method to determine, if this editor contains any change markers.
2614 2678
5203 self.markerDeleteHandle(handle) 5267 self.markerDeleteHandle(handle)
5204 self.notcoveredMarkers = [] 5268 self.notcoveredMarkers = []
5205 self.coverageMarkersShown.emit(False) 5269 self.coverageMarkersShown.emit(False)
5206 self.showingNotcoveredMarkers = False 5270 self.showingNotcoveredMarkers = False
5207 5271
5272 def getCoverageLines(self):
5273 """
5274 Public method to get the lines containing a coverage marker.
5275
5276 @return list of lines containing a coverage marker (list of integer)
5277 """
5278 lines = []
5279 line = -1
5280 while True:
5281 line = self.markerFindNext(line + 1, 1 << self.notcovered)
5282 if line < 0:
5283 break
5284 else:
5285 lines.append(line)
5286 return lines
5287
5208 def hasCoverageMarkers(self): 5288 def hasCoverageMarkers(self):
5209 """ 5289 """
5210 Public method to test, if there are coverage markers. 5290 Public method to test, if there are coverage markers.
5211 5291
5212 @return flag indicating the presence of coverage markers (boolean) 5292 @return flag indicating the presence of coverage markers (boolean)
5377 selist.append(self.markerLine(handle) + 1) 5457 selist.append(self.markerLine(handle) + 1)
5378 5458
5379 selist.sort() 5459 selist.sort()
5380 return selist 5460 return selist
5381 5461
5462 def getSyntaxErrorLines(self):
5463 """
5464 Public method to get the lines containing a syntax error.
5465
5466 @return list of lines containing a syntax error (list of integer)
5467 """
5468 lines = []
5469 line = -1
5470 while True:
5471 line = self.markerFindNext(line + 1, 1 << self.syntaxerror)
5472 if line < 0:
5473 break
5474 else:
5475 lines.append(line)
5476 return lines
5477
5382 def hasSyntaxErrors(self): 5478 def hasSyntaxErrors(self):
5383 """ 5479 """
5384 Public method to check for the presence of syntax errors. 5480 Public method to check for the presence of syntax errors.
5385 5481
5386 @return flag indicating the presence of syntax errors (boolean) 5482 @return flag indicating the presence of syntax errors (boolean)
5488 fwlist.append(self.markerLine(handle) + 1) 5584 fwlist.append(self.markerLine(handle) + 1)
5489 5585
5490 fwlist.sort() 5586 fwlist.sort()
5491 return fwlist 5587 return fwlist
5492 5588
5589 def getWarningLines(self):
5590 """
5591 Public method to get the lines containing a warning.
5592
5593 @return list of lines containing a warning (list of integer)
5594 """
5595 lines = []
5596 line = -1
5597 while True:
5598 line = self.markerFindNext(line + 1, 1 << self.warning)
5599 if line < 0:
5600 break
5601 else:
5602 lines.append(line)
5603 return lines
5604
5493 def hasWarnings(self): 5605 def hasWarnings(self):
5494 """ 5606 """
5495 Public method to check for the presence of warnings. 5607 Public method to check for the presence of warnings.
5496 5608
5497 @return flag indicating the presence of warnings (boolean) 5609 @return flag indicating the presence of warnings (boolean)

eric ide

mercurial