ViewManager/ViewManager.py

changeset 1546
240f55bb6e26
parent 1520
25d97c7ea897
child 1754
4e2f87d03546
equal deleted inserted replaced
1544:d06ffad32855 1546:240f55bb6e26
3649 self.currentEditor.highlight() 3649 self.currentEditor.highlight()
3650 self.currentEditor = None 3650 self.currentEditor = None
3651 3651
3652 self.__setSbFile() 3652 self.__setSbFile()
3653 3653
3654 def openSourceFile(self, fn, lineno=None, filetype="", 3654 def openSourceFile(self, fn, lineno=-1, filetype="",
3655 selStart=0, selEnd=0, pos=0): 3655 selStart=0, selEnd=0, pos=0):
3656 """ 3656 """
3657 Public slot to display a file in an editor. 3657 Public slot to display a file in an editor.
3658 3658
3659 @param fn name of file to be opened (string) 3659 @param fn name of file to be opened (string)
3669 3669
3670 if newWin: 3670 if newWin:
3671 self._modificationStatusChanged(editor.isModified(), editor) 3671 self._modificationStatusChanged(editor.isModified(), editor)
3672 self._checkActions(editor) 3672 self._checkActions(editor)
3673 3673
3674 if lineno is not None and lineno >= 0: 3674 if lineno >= 0:
3675 editor.ensureVisibleTop(lineno) 3675 editor.ensureVisibleTop(lineno)
3676 editor.gotoLine(lineno, pos) 3676 editor.gotoLine(lineno, pos)
3677 3677
3678 if selStart != selEnd: 3678 if selStart != selEnd:
3679 editor.setSelection(lineno - 1, selStart, lineno - 1, selEnd) 3679 editor.setSelection(lineno - 1, selStart, lineno - 1, selEnd)
3680 3680
3681 # insert filename into list of recently opened files 3681 # insert filename into list of recently opened files
3682 self.addToRecentList(fn) 3682 self.addToRecentList(fn)
3683 3683
3684 def __connectEditor(self, editor): 3684 def __connectEditor(self, editor):

eric ide

mercurial