ViewManager/ViewManager.py

changeset 832
eb5ff61f927b
parent 826
2e3e2055e715
child 880
52ed20236a1c
equal deleted inserted replaced
831:f046b97785db 832:eb5ff61f927b
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 = "", selStart = 0, selEnd = 0): 3102 def openSourceFile(self, fn, lineno = None, filetype = "",
3103 selStart = 0, selEnd = 0, pos = 0):
3103 """ 3104 """
3104 Public slot to display a file in an editor. 3105 Public slot to display a file in an editor.
3105 3106
3106 @param fn name of file to be opened (string) 3107 @param fn name of file to be opened (string)
3107 @param lineno line number to place the cursor at (integer) 3108 @param lineno line number to place the cursor at (integer)
3118 self._modificationStatusChanged(editor.isModified(), editor) 3119 self._modificationStatusChanged(editor.isModified(), editor)
3119 self._checkActions(editor) 3120 self._checkActions(editor)
3120 3121
3121 if lineno is not None and lineno >= 0: 3122 if lineno is not None and lineno >= 0:
3122 editor.ensureVisibleTop(lineno) 3123 editor.ensureVisibleTop(lineno)
3123 editor.gotoLine(lineno) 3124 editor.gotoLine(lineno, pos)
3124 3125
3125 if selStart != selEnd: 3126 if selStart != selEnd:
3126 editor.setSelection(lineno - 1, selStart, lineno - 1, selEnd) 3127 editor.setSelection(lineno - 1, selStart, lineno - 1, selEnd)
3127 3128
3128 # insert filename into list of recently opened files 3129 # insert filename into list of recently opened files

eric ide

mercurial