There are a couple of ways to do it. One way is to allow the user to edit, and then provide a "Save" button that will get the updated values from lhs/rhs.
If you want more dynamic updates, then you would need to get the CodeMirror editor for each side:
http://www.mergely.com/doc#mergely-cm, and then register change events (
http://codemirror.net/doc/manual.html#events). The problem with this approach is that updates can be frequent, so you will asynchronously hammer your backend. The asynchronous nature of it means that the events can be processed in any order. Not so nice.