Added write check so you don't have to move the cursor to update the statusline