On Fri, Oct 8, 2010 at 2:03 AM, Jonathan Lundell <[email protected]> wrote:
> On Oct 7, 2010, at 9:18 PM, mdipierro wrote:
>>
>> Can you check if it is fixed in trunk?
>
> It should fix the bogus compile error, yes. Whether the the error 
> highlighting will work, I don't know; I'm having trouble following the logic.

I think the logic is working fine, as compile() reports the error line
and offset (computed from the last line of the error report), editarea
character offset should be right as it is recomputed from original
request.vars.data.

Sorry for the lack of documentation, I thought the code was self
explanatory, my fault.
This is what it does:
 * compile (now safely converting code line endings), this may raise a
exception if error
 * compute start character position using the error lineno (splitting
and summing previous line lengths form original code)
 * if there is a error text (code fragment) and offset (inside that
code fragment), compute relative offset to actual error line (code
fragment may have several previous context code lines)
 * report start and end (start+offset) character positions to the
client, to be used by editarea to select (hughlight) offending line

If you have any questions just let me know,

Best regards,

Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com

Reply via email to