[CM Merge] how to programmatically focus on line that has code changes

Hi, am using codemirror merge view I just wanted to focus and scroll to the line number or word that the code changed. assume the below image. I have code changes on lines 3 and 12. - I will keep once up and down arrow icon. which we used to click to move focus on code-changed lines. please suggest me.

1 Like

Hi, @marijn is there any way to get the highlighted line numbers from MergeView as an array?
I was just checking CM6 Merge Demo and found that there is a chuncks (private member ). which gives details of position and changes. I think these values are enough for me to get scrolled into the position. is there any other way to get the line numbers as an array where the changes occurred?
also, i tried with

import { presentableDiff } from ‘’@codemirror/merge’’

and passed doc values to presentableDiff and compared with chunks values and presentableDiff values. I don’t think it’s the same. the position gives different for each one.

i hope it would be great if there is any way to get this chucks or line number.

@codemirror/merge 0.1.2 exports MergeView.chunks and documents the objects used in there.

1 Like

Great that should solve my need.
Thanks for the update. and reply.