Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-10788

Generic Highlighter doesn't mapp some ds____ style of Kate definitions

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • Qt Creator 3.0.0-rc1
    • Qt Creator 2.7.0, Qt Creator 2.8.0, Qt Creator 3.0.0-rc1
    • Editors
    • None
    • Linux Ubuntu 13.04 32bit + Qt5.1.1 + QtCreator 2.8.1,
      Linux Ubuntu 12.04.3 32bit + Qt5.2beta + QtCreator 3.0beta
    • 85e6f8a1c817ed18305efb3e10896e750e8b24c6

    Description

      While recently trying to create a Kate syntax coloration file for generic highlighter, I noticed that there are some ds***** style that are not taken in account by QtCreator Plain Text Editor coloration :

      • dsFunction
      • dsOther
      • dsError

      These styles are rendered as normal text, not colorated.

      After investigating into the generic highlighter source code, some information appears :

      • String containing 'ds****' are correcly mapped to a Highlighter::TextFormatId enum, all of them, in the src/plugins/texteditor/generichighlighter/highlighter.cpp file, inside Highlighter::KateFormatMap::KateFormatMap() function.
      • Some TextFormatId are never used again and they appear to be the one that aren't colorated. The one which work are used inside src/plugins/texteditor/plaintexteditor.cpp, inside the void PlainTextEditorWidget::setFontSettings(const FontSettings &fs) function, to be bound to a TextEditor::TextFormat.
      • There is no existing TextEditor::TextFormat for Other or Error but there is one for Function so at least this one can be fixed quickly.

      To FIX dsFunction coloration and make it use the 'function' style defined inside Options, just add the following line :

      highlighter->configureFormat(Highlighter::Function, fs.toTextCharFormat(C_FUNCTION));

      inside the void PlainTextEditorWidget::setFontSettings(const FontSettings &fs)function and it should work.

      Please fix it quickly as it's a simple solution and that can make QtCreator even more adapted for multi-purpose editing !

      Cheers.

      Attachments

        Activity

          People

            davschul David Schulz
            thebootroo Thomas Boutroue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: