feature request: partial-context diff

Jamie Peabody jamie.peabody at gmail.com
Thu Feb 12 16:21:24 EST 2015


Yes, markText is probably the right way to do it.

Around 1195
<https://github.com/wickedest/Mergely/blob/master/lib/mergely.js#L1195>, it
iterates through the list of changes and builds an array of *marktext*.
That marktext is used on line 1251
<https://github.com/wickedest/Mergely/blob/master/lib/mergely.js#L1251> and
1259 <https://github.com/wickedest/Mergely/blob/master/lib/mergely.js#L1259> to
apply markup.

I think the right way to do it would be to something similar for
non-changes.  E.g., if line 6-10 changed, then non-changes would be 1-5 and
11+.

Anyhow, it's a good start.


On 12 February 2015 at 20:31, Thomas De Schampheleire <
patrickdepinguin at gmail.com> wrote:

> Hi Jamie,
>
> On Thu, Feb 12, 2015 at 5:34 PM, Jamie Peabody <jamie.peabody at gmail.com>
> wrote:
> > Hi Thomas,
> >
> > Kallithea looks cool, and I saw the Mergely integration that was done
> there.
> > Looks good.  It should be possible to do it with folding.  It might not
> be
> > too difficult.  I am rather busy right now - but if someone wants to
> have a
> > go at it, I will give my assistance and support.
> >
>
> I had a brief look at the codemirror code and manual, and I see two
> potentially useful things:
> - doc.markText(from: {line, ch}, to: {line, ch}, ?options: object) →
> TextMarker
>   which has a 'collapsed' property.
>   From how I understand it, one should be able to create a marker
> between two lines and collapse it.
>   http://codemirror.net/doc/manual.html#api_marker
>
> - the codefold add-on (
> http://codemirror.net/doc/manual.html#addon_foldcode)
>   although this may be less suitable in this case.
>
> Is this more or less what you had in mind?
>
> How to find out which lines are suitable for collapsing, from mergely?
> And how/where should one start hooking this into mergely?
>
> Thanks,
> Thomas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sfconservancy.org/pipermail/kallithea-general/attachments/20150212/e6b87ffc/attachment.html>


More information about the kallithea-general mailing list