QScintilla/Editor.py

changeset 2490
3d011f457ddd
parent 2424
8fe1fdc174ab
child 2493
476f6016114d
equal deleted inserted replaced
2488:0ac8e48f7092 2490:3d011f457ddd
3155 commentStr = self.lexer_.commentStr() 3155 commentStr = self.lexer_.commentStr()
3156 line, index = self.getCursorPosition() 3156 line, index = self.getCursorPosition()
3157 3157
3158 # check if line starts with our comment string (i.e. was commented 3158 # check if line starts with our comment string (i.e. was commented
3159 # by our comment...() slots 3159 # by our comment...() slots
3160 if not self.text(line).strip().startswith(commentStr): 3160 if self.hasSelectedText() and \
3161 self.text(self.getSelection()[0]).strip().startswith(commentStr):
3162 self.uncommentLineOrSelection()
3163 elif not self.text(line).strip().startswith(commentStr):
3161 # it doesn't, so comment the line or selection 3164 # it doesn't, so comment the line or selection
3162 self.commentLineOrSelection() 3165 self.commentLineOrSelection()
3163 else: 3166 else:
3164 # determine the start of the comment block 3167 # determine the start of the comment block
3165 begline = line 3168 begline = line

eric ide

mercurial