def event_nameChange(self):
#a nameChange event is fired by breakpoint UI control when the caret reaches a line with breakpoint, so, we rely on this to announce breakpoints
global caretMovedToDifferentLine
if not caretMovedToDifferentLine:
#a nameChange event can be fired multiple times when moving by character within the same line, so, return if we already announced the break point for the current line
return
caretMovedToDifferentLine = False
currentLineNum = _getCurLineNumber()
BPLineNum = self._getLineNumber()
if currentLineNum == 0 or BPLineNum == 0 \
or currentLineNum != BPLineNum:
return
if config.conf["visualStudio"]["beepOnBreakpoints"]:
tones.beep(1000, 50)
if not config.conf["visualStudio"]["announceBreakpoints"]:
return
message = _("breakpoint")
state = re.search(REG_GET_BREAKPOINT_STATE, self.name)
if state:
message += " "
message += state.group()
ui.message(message)
评论列表
文章目录