retrieve the content of a mergeView pane


#1

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!

Best,

Michael


how to use the change event with mergeview?
#2

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?


#3

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?


#4

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


#5

great, thanks marijn!