Menu

Set language coloration to a new document

Help
pitibalrog
2015-09-17
2015-10-19
  • pitibalrog

    pitibalrog - 2015-09-17

    Hi,

    I'm trying to make a script which create an XML document.

    It works but I cant achieve to set the XML language coloration on this document.

    I tryed several things like above, but it didn't work (no error but document stay to Normal text file).

    editor.setLexerLanguage('XML')
    editor.setLexer(LEXER.XML)
    editor.changeLexerState(0, -1)
    editor.colourise(0, -1)

    I tryed to use Notepad.setLangType(langType[, bufferID]) but I don't know how to use

    notepad.setLangType(LANGTYPE.L_XML)

    How can I set my document langage to XML with XML coloration?

    PS: In documentation there's Notepad.setCurrentLang(langType) but I've error saying it doesn't exist.

     
  • Dave W.

    Dave W. - 2015-09-25

    Have you tried "notepad.menuCommand(MENUCOMMAND.LANG_XML)"?
    ;)

     
  • pitibalrog

    pitibalrog - 2015-10-19

    Yes I ended to use this command but I liked to understand why the previous solution doesn't work

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.