locate: fix offset error when recovering identifier under the cursor