fix cursor moving bug
add current_offset attribute to buffer