avoid model model<->codemirror update loop

cbugg: bug-288

I hope this fixes this. @steve, others, let me know if you see it again.