improve handling of buffer open in more than one window