Prototype for TextDocument.Conflict objects.
You cannot create conflict objects. To access them inside a document you can do this:
if (doc instanceof TextDocument)
{
for (var idxc=0;
idxc<doc.conflicts.length; ++idxc)
{
var
my_conflict = doc.conflicts[idxc];
// do
whatever you like!
}
}
none.
none.
ECMerge 2.1
TextDocument.Conflict objects give you information about
which lines of the contents are covered by this conflict, which
solution would be given, which differences are contained by
this conflict.
It let you compute which solution text would be given for
such and such resolution choice.
Property | Description |
conflicting | Boolean. True if the conflict is not (yet) solved. |
result_text | String. Text currently used as a solution for this conflict |
solution | Text Conflict State string. Solution currently used to solve this conflict |
differences
lines
get_solution_text
Logs the text currently used as a solution for the first conflict of a merge:
log (current_frame.coordinator.document.conflicts[0].result_text);
TextDocument object, Text Conflict State string
function diffs ( couple )
returns a
LinearRange
object
side. Side Couple string. Couple from which the differences ranges are requested.
TextDocument.Conflict object.
ECMerge 2.1
Returns the range of indices in the matching
TextDocument.differences( ) array of the differences which
are encompassed by this conflict.
Currently:
TextDocument.Conflict object, LinearRange object
function lines ( side )
returns a
LinearRange
object
side. Side string. Side for which the range of lines is requested
TextDocument.Conflict object.
ECMerge 2.1
Returns the range of lines which are covered by the conflict, in a given side.
Navigates to the start of first conflict in the current view:
var doc = current_frame.coordinator.document;
var side = current_frame.coordinator.current_view.role;
var content = doc.contents[side];
current_frame.coordinator.current_view.navigate (
content.position_from_line (doc.conflicts[0].lines(side).start)
);
TextDocument.Conflict object, LinearRange object
function get_solution_text ( solution_kind )
returns a String
solution_kind. Text Conflict State string. The pre-defined solution kind for which the text is queried
TextDocument.Conflict object.
ECMerge 2.1
Returns the text that would be used to solve this conflict if the given solution_kind was chosen by the user in the UI. It allows the programmer to compute the merge of texts when no UI is available.
TextDocument.Conflict object, Text Conflict State string