retrieve the content of a mergeView pane

Hi there! I’m using the mergeView addon. I’d like to be able to retrieve the current content (code entered) in each of the editors – by clicking a button, for example.

I’m assuming cm.getDoc() would need to be used, which I’ve tried, but I don’t know how it works nor how to implement it correctly.

Thanks, love this work!



You can get access to the editor in the merge view with its editor method, so maybe .editor().getValue() is what you are looking for?

ah great thanks! Yes this worked for the main editor pane. Now, if I have a 2-way mergeview, is there any chance I can do the exact same on second editor pane?

Yes, use .leftOriginal() or .rightOriginal(), depending on which side you’re showing the original.

great, thanks marijn!