Add ability to create codemirror with merge plugin, fixes #91
This let's you use the merge plugin by adding merge-view to the directive.
Example:
<ui-codemirror
merge-view
ui-codemirror-opts="options"
ng-model="editCopy">
</ui-codemirror>
$scope.options = {
orig: 'StringToCompareWith',
lineNumbers: true,
highlightDifferences: true,
connect: true,
collapseIdentical: false
}
I needed to use the merge plugin so I have done some functional testing of this PR. As far as I can tell this seems to work. I think it would be a good idea if these changes could be considered for integration.
Hello,
Any news about this contribution ?
I don't understand how to use merge plugin.
Both values (old and new) I receive from ajax ($resource), and on initialisation moment I have no values... What I should do?
html
js $scope.editorOptions = { mode: 'xml', lineNumbers: true, highlightDifferences: true, connect: true, collapseIdentical: false };
...GET { $scope.leftVar = val1; $scope.rightVar = val2; $scope.editorOptions.origLeft = $scope.rightVar; }
I used hack. Wrap in ng-if and directive start only after ajax complete.