Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Change the styling of a text

Help
2011-11-25
2013-01-25
  • Viczian Istvan
    Viczian Istvan
    2011-11-25

    The setStyling doesn't work for me. I open a new editor and the console. I type some text into the editor. Then I type the following into the console:
    editor.styleSetFore(9, (0,0,255))
    editor.startStyling(0, 0xff)
    editor.setStyling(6, 9)

    But nothings happen. The editor.getStyledText returns 0 for styles.

    The following code works fine:

    editor.addStyledText(Cell("Hello in blue\n", ))

     
  • Viczian Istvan
    Viczian Istvan
    2011-11-25

    How can I change the styling of a text?

     
  • You need to set the lexer to the container, otherwise scintilla will ignore the calls for startStyling and so on.

    editor.setLexer(LEXER.CONTAINER)
    

    Cheers,
    Dave.

     
  • Viczian Istvan
    Viczian Istvan
    2011-11-26

    Dear Dave,

    Thank you for your incredible quick answer, it works! This plugin is awesome!

    Istvan