make sure BufEnter, BufLeave events work well