2664Re: [jasspa] suddenly everything quote highlighted!
- Oct 31, 2011On 31 Oct 2011, at 21:33, Reza Roboubi <reza@...> wrote:
> On 11-10-31 01:19 PM, Jon Green wrote:Hi Reza,
>> On 31/10/2011 15:07, Reza Roboubi wrote:
>>> On 11-10-31 06:11 AM, Jon Green wrote:
>>>> If you are able to send some code that reproduces the issue then
>>> that would be useful.
>>> Okay, the attached file will narrow it down pretty nicely. Line 52 must
>>> be scrolled to the top of the page and then the highlighting is wrong.
>>> This is the version information and buffer mode is a standard .c file:
>> Hi Reza,
>> The issue is the look-back length in the template file. In the file
>> that you have posted then by scrolling to line 52 then the
>> highlighting is
>> expected to look back more than 50 lines in order to find an anchor
>> point on
>> which to base its highlighting scheme for the current line.
>> If you look at hkc.emf which performs the highlighting then the
>> template is
>> defined with a 50 line look back at line 110 i.e.
>> ; Hi-light C Mode
>> 0 hilight .hilight.c 2 50
> Thank you Jon. First, the problem is that the quotes are escaped.
> Without the escapes everything works. In this simple case, the easy
> work-around is to put such comments inside separate "README" files.
> The "hilight 150" look-back feature isn't _really_ for handling this
> problem, but rather, the "50" is the "largest comment size possible" in
> case that you are actually starting _inside_ a comment already.
> Eventually (if not too messy) it would be great to modify hilight to be
> globally precise and complete: hilight only needs to mark, globally and
> persistently, per-buffer, approximately every 40 lines or 400 characters
> or so. The marking says: "This Line Or Character lies outside any
> bracketed region."
> With markings like that we can _completely_ eliminate hilight's
> "look-back" parameter. The user never even needs to know about hilight
> That way hilight can even scale to ridiculously huge files (for example
> preprocessed output or whatever else.)
I do not quite agree with your analysis because the quotes are fine in the comment when the current position is less than the look-back distance away. If the quotes in the comment were generally a problem then you would expect this to cause a problem irrespective of the actual distance of the offending statement away from the comment.
You can check out it is the look back length by changing the value to 51 and the bad highlighting is then ok. Then insert a new line into ooo.c before the statement and scroll up the window then the highlight anomaly returns. You can repeat this a few times by changing the look back and then line position.
So I would not expect that you should be forced to re-organise your codebase by taking some drastic action to separate out some of the code because of the editor you use.
There are a lot of look back sizes in the template file for the various hilighting schemes, including comments. I think we should parameterise these values so that it is much easier to increase them all in one go rather than using constants. 50 is a little small these days, especially for some of the public domain software with large version histories and licenses contained, with the current processing power available the longer look back does not really become noticeable.
As for your idea of putting down anchors, this has potential benefits, I am not sure if this completely eradicates look back in its entirety because it must still be performed for brackets in lines.
> This is an unmoderated list, but new members are moderated to ensure that there are no spam users. JASSPA is not responsible for the content of
> any material posted to this list.
> To un-subscribe, send a mail message to
> or visit http://groups.yahoo.com/group/jasspa and
> modify your account settings manually.
> Yahoo! Groups Links
- << Previous post in topic Next post in topic >>