fix buffer cursor scrolling issue