def findParagraph(self, start, end=-1): """Override the standard findParagraph to properly handle Fortran comment blocks. Comment blocks start with c, C, or ! in column 1. """ # See if cursor is inside a comment block try: info = F77CommentParagraph(self, start) except BadParagraphError: # Check if cursor is on the last line of a comment block, possibly # after the comment. linenum = self.LineFromPosition(start) start = self.PositionFromLine(linenum) try: info = F77CommentParagraph(self, start) except BadParagraphError: # Nope, treat it as a regular paragraph info = FundamentalMode.findParagraph(self, start, end) return info
def findParagraph(self, start, end=-1): """Override the standard findParagraph to properly handle several styles of C comment blocks. C style comment blocks may look like: /* line ** line */ or /* line * line */ or /* line line */ or any number of similar variations. This is a postprocessing call on the fundamental mode's findParagraph that can manipulate the ParagraphInfo object if it finds a comment block. """ # See if cursor is inside a comment block try: info = CCommentParagraph(self, start) except BadParagraphError: # Check if cursor is on the last line of a comment block, possibly # after the comment. linenum = self.LineFromPosition(start) start = self.PositionFromLine(linenum) try: info = CCommentParagraph(self, start) except BadParagraphError: # Nope, treat it as a regular paragraph info = FundamentalMode.findParagraph(self, start, end) return info