Focus editor when tab change and correct selection when opening file