Switch buffer if file is opened instead of calling edit all the time.

This fix the problem where the cursor would always return at the beginning of the file when switching to an already opened file.