You can use nvim_buf_get_extmarks to get those changed line numbers and get the new line location, no need for hash I think.
You can use nvim_buf_get_extmarks to get those changed line numbers and get the new line location, no need for hash I think.