[Eric] weird edgecolumn behavior in scintilla

SHY soundplay at gmail.com
Tue Aug 28 08:25:13 BST 2007


hey everyone,

i decided its time to heavily improve myself in python-gui programming and
so i started building my own editor/ide for PHP. so far, most of the
general/basic features are inspired (read: mostly copy-pasted) by eric4 IDE
as it is too based upon qt4 and scintilla.

but i came across to a weird problem with the scintilla's edgemodes. when i
set it up to edgeline mode and the edgecolumn is set to 80, the edgeline is
drawn (assuming the default scintilla/eric settings) at approximately 50th
character from the left (and 30th character when the lexer is off - aka txt
files), instead of the expected 80. ive tried to play around with the
lexers' styles to change fonts (courier new, size 10) and stuff but it keeps
drawing the line on 50th column.

ive made a non-elegant and non-pragmatic workaround to this, by setting the
edgecolumn to 128 when the lexer is turned on and 213 when it is off. both
values approximately match the 80th column for courier-new size 10.

i originally thought that the column length for the edgecolumn value is
computed from the character width of the particular font, and so that by
changing the font or its size, the edgecolumn would change appropriately.
dunno if this is the problem of scintilla (cause the exactly same thing is
present in eric4 as well) or i just missed some important setting.

this is the code that handles the edgecolumn stuff when the editor is
launched:

[code]
        edgeMode = Preferences.getEditor("EdgeMode")
        edge = QsciScintilla.EdgeMode(edgeMode)
        self.setEdgeMode(edge)
        if edgeMode:
            self.setEdgeColumn(Preferences.getEditor("EdgeColumn"))
            self.setEdgeColor(Preferences.getEditorColour("Edge"))

[/code]

the EdgeColumn preferences value defaults to 80.

any ideas?

thanks in advance.
SHY
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/eric/attachments/20070828/92a110c2/attachment.html


More information about the Eric mailing list