Embedding informational lines in the document

10 views
Skip to first unread message

seth

unread,
Dec 6, 2007, 2:50:55 PM12/6/07
to scintilla-interest
I have an issue with my upgrade from 1.73 to 1.75. I'm looking for
some suggestions on supporting some new functionality.

The functionality that I desire is to be able to add lines into the
source that are not part of the document. An example of where this
could be useful is for a debugging environment to insert the assembly
for C source lines into the C source document. This is a useful
feature when attempting to optimize your C source. Another use is to
add compiler annotations to the source. If a compiler has the ability
to report additional information concerning particular source lines,
its useful to be able to display this information in the body of the
source file.

I started working with scintilla.dll version 1.73 and was able to
provide the desired functionality. I modified the ContractionState and
OneLine classes to include the concept of a "false line". A false line
is essentially a line that is not included when determining the source
line number, but exists in the view. This way when dealing with mouse
clicks and displaying the line number in the margin, the lines can be
handled appropriately. I did this essentially by adding an attribute
to the OneLine class to indicate if it is a false line, and a new
array to the ContractionState class to keep track of the line numbers.
Appropriate modifications to maintain this information.

When I downloaded 1.75 I see that the ConstractionState class has
changed significantly. Does anyone have any suggestions on how I could
accomplish the same thing in 1.75 ?

Thanks,

Seth Molloy
Analog Devices
DSP Tools Division
Norwood, MA

Neil Hodgson

unread,
Dec 6, 2007, 6:31:28 PM12/6/07
to scintilla...@googlegroups.com
seth:

> ... was able to


> provide the desired functionality. I modified the ContractionState and
> OneLine classes to include the concept of a "false line". A false line
> is essentially a line that is not included when determining the source
> line number, but exists in the view.

> ...


> When I downloaded 1.75 I see that the ConstractionState class has
> changed significantly. Does anyone have any suggestions on how I could
> accomplish the same thing in 1.75 ?

You will need to include the false line data in ContractionState
and then change the methods to return modified values in a similar way
to your previous changes. You could use an extra RunStyles to hold the
number of false lines for each doc line similar to heights. Then
either take this into account at each entry point or combine the
effects of visible, expanded, heights and the new data when modifying
displayLines.

Neil

seth

unread,
Dec 7, 2007, 10:38:37 AM12/7/07
to scintilla-interest
Thanks Neil,

I'll let you know how it works out.

~Seth

seth

unread,
Dec 17, 2007, 12:53:44 PM12/17/07
to scintilla-interest
Thanks again, turned out to be pretty simple to fix. I opted for the
less efficient but simpler solution of taking into account the false
lines at each entry point. Mainly to avoid difficult merges in the
future.

If anyone has any interest in this feature let me know and I'll
provide a patch.

Seth Molloy
Analog Devices
Reply all
Reply to author
Forward
0 new messages