Logo Search packages:      
Sourcecode: yzis version File versions  Download package

const YColor & YView::drawColor ( int  col,
int  line 
) const

Character color at column line

Definition at line 1325 of file view.cpp.

References YLine::attributes(), YLine::data(), getLocalIntegerOption(), YBuffer::highlight(), YLine::length(), mBuffer, YzisAttribute::textColor(), and YBuffer::yzline().

{
    YLine *yl = mBuffer->yzline( line );
    YzisHighlighting * highlight = mBuffer->highlight();
    const uchar* hl = NULL;
    YzisAttribute *at = NULL;

    if ( yl->length() != 0 && highlight ) {
        hl = yl->attributes(); //attributes of this line
        hl += col; // -1 ? //move pointer to the correct column
        int len = hl ? highlight->attributes( 0 )->size() : 0 ; //length of attributes
        int schema = getLocalIntegerOption("schema");
        YzisAttribute *list = highlight->attributes( schema )->data( ); //attributes defined by the syntax highlighting document
        at = ( ( *hl ) >= len ) ? &list[ 0 ] : &list[*hl]; //attributes pointed by line's attribute for current column
    }
    if ( opt_list && ( yl->data().at(col) == ' ' || yl->data().at(col) == tabChar ) )
        return blue;
    if ( at ) return at->textColor(); //textcolor :)
    return color_null;
}


Generated by  Doxygen 1.6.0   Back to index