Ellié Computing Home Page
My Shopping Cart

Your shopping cart is empty

Display Cart

Call us at +1 586 62 ELLIE / +1 586 62 35543 Office Closed
sales@elliecomputing.com - Contact us


TextDocument.Conflict object

 

 

Prototype for TextDocument.Conflict objects.

Syntax

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!
    }
}

Parameters

 none.

Property Of

none.

Implemented In

ECMerge 2.1

Description

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.

Properties

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

Methods

differences
lines
get_solution_text

Examples

Example 1.

Logs the text currently used as a solution for the first conflict of a merge:

log (current_frame.coordinator.document.conflicts[0].result_text);

See Also 

  TextDocument object, Text Conflict State string

Method differences

Syntax

function diffs ( couple )
returns a LinearRange object

Parameters

side.  Side Couple string. Couple from which the differences ranges are requested.

Method Of

TextDocument.Conflict object.

Implemented In

ECMerge 2.1

Description

Returns the range of indices in the matching TextDocument.differences( ) array of the differences which are encompassed by this conflict.
Currently:

  • in 3-way, only "ancestor-left" and "ancestor-right" are correct values.
  • in 2-way, only "left-right" is a correct value

Examples

Example 1.

 

See Also 

  TextDocument.Conflict object, LinearRange object

 

Method lines

Syntax

function lines ( side )
returns a LinearRange object

Parameters

side. Side string. Side for which the range of lines is requested

Method Of

TextDocument.Conflict object.

Implemented In

ECMerge 2.1

Description

Returns the range of lines which are covered by the conflict, in a given side.

Examples

Example 1.

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) );

See Also 

  TextDocument.Conflict object, LinearRange object

Method get_solution_text

Syntax

function get_solution_text ( solution_kind )
returns a String

Parameters

solution_kind. Text Conflict State string. The pre-defined solution kind for which the text is queried

Method Of

TextDocument.Conflict object.

Implemented In

ECMerge 2.1

Description

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.

Examples

Example 1.

 

See Also 

  TextDocument.Conflict object, Text Conflict State string