#510 false lines

Scintilla (358)

(quoting Seth Molloy seth.molloy@gmail.com)
<< The desired functionality 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, it is useful to be able to display this information in the body of the source file.

I was able to provide the desired functionality into a 1.75, using 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.>>

(Ludovic Aubert ludo.aubert@gmail.com)
I use this functionality in a diff/merge/clone tool. This feature is a must have for any kind of diff tool because these tools typically need to show views with inserted gaps which must be taken into account by the line numbering.

I'd be very interested to have this feature merged into the next Scintilla release. It is very easy to do it now, Seth has done a vey good job. But if we wait too much, it will become harder to merge as future versions will diverge from 1.75.

Thank you for letting me know what happens: ludo.aubert@gmail.com


  • Nobody/Anonymous

    modified 1.75 with the false line feature by Seth Molloy

  • Neil Hodgson

    Neil Hodgson - 2008-07-13

    Logged In: YES
    Originator: NO

    This does appear to be a useful feature.

    The implementation is not minimal and decreases performance for applications that do not need the feature.

    The GetMark method in Accessor is not needed for false lines and should be a separate issue. New methods should go at the end of the class. The new method should also be implemented in the other subclass WindowAccessor.

    The bEnumerated argument to ContractionState::InsertLine and ContractionState::InsertLines appears to always be true so should be omitted. There is some extraneous code at the end of DisplayFromLineNum possibly left over from debugging. The use of the term "display" such as in SCI_DISPLAYLINEFROMPOSITION is confusing as Scintilla currently uses the term "displayLine" to refer to a line number in the window as contrasted with a "documentLine". There should be a new term for the number displayed in the margin.

    The performance issue occurs because both DisplayFromLineNum and LineNumFromDisplay have to loop through all preceding document lines. ContractionState uses the Partitioning class which can convert between display lines and document lines much faster: O(log n) from display to doc and O(1) in the opposite direction. While there is probably a way to avoid iteration here (possibly through a Partitioning that can tell how many false lines there are before a particular document line) there should at least be a fast path when there are no false lines since most applications will not use false lines.

  • Neil Hodgson

    Neil Hodgson - 2008-07-13
    • assigned_to: nobody --> nyamatongwe
  • Neil Hodgson

    Neil Hodgson - 2009-04-28

    A similar feature 'annotations' implemented in 1.78.

  • Neil Hodgson

    Neil Hodgson - 2009-04-28
    • milestone: --> Completed
    • status: open --> closed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks