QScintilla/Editor.py

branch
5_3_x
changeset 2491
c6e2c7b1a52e
parent 2393
0944855208d9
child 2495
33cbc28c3ba9
equal deleted inserted replaced
2489:4f6cc64ca547 2491:c6e2c7b1a52e
3179 commentStr = self.lexer_.commentStr() 3179 commentStr = self.lexer_.commentStr()
3180 line, index = self.getCursorPosition() 3180 line, index = self.getCursorPosition()
3181 3181
3182 # check if line starts with our comment string (i.e. was commented 3182 # check if line starts with our comment string (i.e. was commented
3183 # by our comment...() slots 3183 # by our comment...() slots
3184 if not self.text(line).strip().startswith(commentStr): 3184 if self.hasSelectedText() and \
3185 self.text(self.getSelection()[0]).strip().startswith(commentStr):
3186 self.uncommentLineOrSelection()
3187 elif not self.text(line).strip().startswith(commentStr):
3185 # it doesn't, so comment the line or selection 3188 # it doesn't, so comment the line or selection
3186 self.commentLineOrSelection() 3189 self.commentLineOrSelection()
3187 else: 3190 else:
3188 # determine the start of the comment block 3191 # determine the start of the comment block
3189 begline = line 3192 begline = line

eric ide

mercurial