3097 self.currentEditor.highlight() |
3097 self.currentEditor.highlight() |
3098 self.currentEditor = None |
3098 self.currentEditor = None |
3099 |
3099 |
3100 self.__setSbFile() |
3100 self.__setSbFile() |
3101 |
3101 |
3102 def openSourceFile(self, fn, lineno = None, filetype = "", |
3102 def openSourceFile(self, fn, lineno = -1, filetype = "", |
3103 selStart = 0, selEnd = 0, pos = 0): |
3103 selStart = 0, selEnd = 0, pos = 0): |
3104 """ |
3104 """ |
3105 Public slot to display a file in an editor. |
3105 Public slot to display a file in an editor. |
3106 |
3106 |
3107 @param fn name of file to be opened (string) |
3107 @param fn name of file to be opened (string) |
3117 |
3117 |
3118 if newWin: |
3118 if newWin: |
3119 self._modificationStatusChanged(editor.isModified(), editor) |
3119 self._modificationStatusChanged(editor.isModified(), editor) |
3120 self._checkActions(editor) |
3120 self._checkActions(editor) |
3121 |
3121 |
3122 if lineno is not None and lineno >= 0: |
3122 if lineno >= 0: |
3123 editor.ensureVisibleTop(lineno) |
3123 editor.ensureVisibleTop(lineno) |
3124 editor.gotoLine(lineno, pos) |
3124 editor.gotoLine(lineno, pos) |
3125 |
3125 |
3126 if selStart != selEnd: |
3126 if selStart != selEnd: |
3127 editor.setSelection(lineno - 1, selStart, lineno - 1, selEnd) |
3127 editor.setSelection(lineno - 1, selStart, lineno - 1, selEnd) |
3128 |
3128 |
3129 # insert filename into list of recently opened files |
3129 # insert filename into list of recently opened files |
3130 self.addToRecentList(fn) |
3130 self.addToRecentList(fn) |
3131 |
3131 |
3132 def __connectEditor(self, editor): |
3132 def __connectEditor(self, editor): |