libhbb-0.4.1.0: Backend for text editors to provide better Haskell editing support.

Safe HaskellNone

Language.Haskell.HBB.Internal.InternalTTree

Synopsis

Documentation

applyInsertionInfoSource

Arguments

:: Indentation

Element offset of the parent element

-> Indentation

The recursive element offset of the parent element if it is of type IncInline or 0 if it is of type NewSection

-> [RecElementOffset]

'Recursive element offset' of all parents between the the current element and the root node

-> [AccLevelOffset]

The accumulated level offset stack

-> [Int]

Parent elemen trailing chars stack

-> Indentation

'Effective indentation' of the parent element

-> Int

Number of lines in the parent element (for NewSection insertion position)

-> Int

Number of NewSection childs the parent element has (for NewSection insertion position)

-> [((BufSpan, RecElementOffset), ClientTTree)] 
-> ((InsertionInfo, RecElementOffset), TTree LineBuf RealSrcSpan (InsertionInfo, RecElementOffset)) 
-> [((BufSpan, RecElementOffset), ClientTTree)] 

This function turns the (internal) transformation-tree (with the recursive elements offsets attached) into a transformation-tree the client understands. This is mostly a task of making the indentation (which first is attached implicitely) explicit which means that each addition begins with enough spaces for example.

The (indentation-)calculations in applyInsertionInfo are kind of complex and therefore 'indentation.markdown' is a concept-paper which describes some details with the help of some examples.

data InsertionInfo Source

Constructors

IncInline BufSpan 
NewSection Int 

Instances