switch to buffer instead of switching to window

if file is already open, switch to it.
in the past, we just check whether the file is opened in current tab.
I think checking by buffer number is better.