Re: [code] [textadept] Updated File Diff Module

From: Gabriel Dubatti <gdubatti.att.gmail.com>
Date: Mon, 27 Feb 2017 09:46:48 -0300

Hi Mitchell,

El 27/02/17 a las 01:04, Mitchell escribió:
> Hi Gabriel,
>
> On Sat, 25 Feb 2017, Gabriel Dubatti wrote:
>
>> Hi Mitchell,
>>
>>
>> El 25/02/17 a las 12:42, Mitchell escribió:
>>> Hi Gabriel,
>>>
>>> On Sat, 25 Feb 2017, Gabriel Dubatti wrote:
>>>
>>>> Hi Mitchell,
>>>>
>>>>
>>>> El 25/02/17 a las 02:11, Mitchell escribió:
>>>>> Hi Gabriel,
>>>>>
>>>>> On Thu, 23 Feb 2017, Mitchell wrote:
>>>>>
>>>>>> Hi Gabriel,
>>>>>>
>>>>>> On Thu, 23 Feb 2017, Gabriel Dubatti wrote:
>>>>>>
>>>>>>> Hi Mitchell,
>>>>>>>
>>>>>>> When you add / remove lines at the top of one file, the other
>>>>>>> can't align properly because annotations are always shown below
>>>>>>> text lines.
>>>>>>>
>>>>>>> The following image shows what happens after adding 3 blank
>>>>>>> lines at the top (NOT OK) and after the first line (OK):
>>>>>>>
>>>>>>> error
>>>>>>>
>>>>>>> Any idea on how to solve this?
>>>>>>
>>>>>> This is a bug. I don't think there's a workaround. Thanks for the
>>>>>> report and the helpful image.
>>>>>
>>>>> Actually, I misread your analysis. Sorry about that (it has been a
>>>>> very long week). You are correct, and this appears to be a
>>>>> limitation with the implementation. I'm not sure how to solve this
>>>>> :( I'm open to suggestions.
>>>>>
>>>>> Cheers,
>>>>> Mitchell
>>>> I think there are 2 options to mitigate this limitation:
>>>> 1) move the annotations from line "0" to line 1 (in this case
>>>> only the first line will be shown out of place)
>>>> 2) force to show the first line as a modification (I'm not sure
>>>> how this will look until testing)
>>>>
>>>> BTW, I'm currently working on a C version of the file/string diff
>>>> algorithm (that doesn't require lots of strings
>>>> creation/destruction like the current C++ version):
>>>> https://github.com/gabdub/ta-tweaks/blob/master/tatoolbar/src/ta_filediff.c
>>>> (work in progress alert)
>>>>
>>>> I'll try to test this options and see what I get and let you know.
>>>
>>> Thanks for taking the initiative. I look forward to seeing any
>>> solution you can come up with, as I don't have much time to try and
>>> fix this edge case.
>>>
>>> Cheers,
>>> Mitchell
>>
>> At least for me, the option (1) don't look bad at all.
>>
>> See the pictures:
>>
>> OK case: 3 lines added under line #1
>>
>>
>>
>> Special case I: "line #0" spaces moved to line #1.
>>
>>
>>
>> Special case II: line #0 and line #1 spaces must be added.
>>
>>
>>
>> Here's the code I'm currently using.
>>
>> [snip]
>
> Cool! Do you mind sending a patch or replacement against my original
> module so I can apply it? I think you might be using your custom Lua C
> extension, as I cannot figure out how to apply this.
>
> Cheers,
> Mitchell

Here's my patch and some screen captures showing what you get after
adding some empty lines:

The patch add the number of blank lines before line #2 and apply them at
the end of the loop.

Cheers,
Gabriel

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 27 Feb 2017 - 07:46:48 EST

This archive was generated by hypermail 2.2.0 : Tue 28 Feb 2017 - 06:51:05 EST