Saves some code on the user side.
Change-Id: I32cd220b6e533f5497a1865f9c34ab9db4cfda79
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
General messages pane should only be opened on direct user interaction.
Task-number: QTCREATORBUG-24430
Change-Id: I62f6849ca5a32f0a75c5a91a667ee704d3632d1a
Reviewed-by: David Schulz <david.schulz@qt.io>
Usually cmake configure input files have the *.in suffix, so if we can
not find highlight definitions for a filename and it has the .in suffix
try again without that suffix.
Fixes: QTCREATORBUG-24465
Change-Id: I7a132eb407c299eb1670e89e2d043a924aed1ede
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Amends 6989c9bbea
Since the change above the filename is checked before the mimetype, so
we have to save it in the same order.
Fixes: QTCREATORBUG-24505
Change-Id: Ib974dc0f69ca56cfd6ee9e34bec238e62f800598
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
We should try to find a definition based on the file path first, before
falling back to the MIME type, since MIME types are not extensible. So,
if we find a definition for a MIME type, there could be others, more
suited ones based on the file path.
Fixes: QTCREATORBUG-7906
Change-Id: I9b35efb26d287dd4c975a8944fca9a310c417394
Reviewed-by: David Schulz <david.schulz@qt.io>
Instead of just the editor with the info bar that was triggering the
download action or none editor if the action was triggered from the
settings dialog.
Change-Id: I4158eeb7fdb0a763d082c6d801b400e8635c7f38
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
by renaming it to Download Definitions and adding a tooltip stating that it
collects all definitions that are missing or were updated after the release and
downloads it to the ksyntax highlighting user folder.
Also adding a separate reload definitions button in the settings behind
the user path.
Change-Id: I059cc98e33147cae910fa4fdb35631d1dca81448
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
If a ksyntax format explicitly defines font attributes like bold,
italic, underline or strike through we now apply those attributes. If
the format defines a colors, we first check whether the color is
readable before setting it.
Fixes: QTCREATORBUG-22646
Fixes: QTCREATORBUG-22229
Fixes: QTCREATORBUG-13545
Change-Id: Id0389b3c71a078dc6d6df74ee5de7f5d479a9bcb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Do not try to match 'text/plain' mime types against highlight
definitions, because it is automatically set if the file contains just
printable characters in the first bytes, in this case file pattern
matching gives better results.
Fixes: QTCREATORBUG-22540
Change-Id: Ifd662cd6961011f5cf5d9232ce5f17d2314b4824
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
If the user state of a block changes while it gets highlighted
the next block will be rehighlighted too. Currently we store the
indentation depth in the block user state. So in order to store the
indentation depth _and_ the information whether the next block needs
to be rehighlighted we bit shift the indentation depth via the
brace depth helper functions from TextDocumentLayaout. And we cannot
store the struct KSyntaxHighlighting::State in the block user state (int)
directly to indicate that the next block also needs a rehighlight so we
toggle just the last bit of the user state.
Fixes: QTCREATORBUG-22290
Change-Id: I632f4416a725dc5fa1667bcab34fb2701294c9b8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.
Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The update to the new KSyntaxHighlight engine was missing the matching
parenthesis highlight that was implemented in the generic highligter.
Fixes: QTCREATORBUG-22095
Change-Id: Ibac0f0739b4e1df63aadf0f18f1b76873e63a2fc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Adapt the respective include inside the TextEditor.
Change-Id: Ie3cb17f1b0e3c0639840bc135156edd354a0aeda
Reviewed-by: David Schulz <david.schulz@qt.io>
Add a button to the multiple definition found info that saves the
definition of the current highlighter for the open document.
Change-Id: I04b1b7571a864d781747547a1d315ec25bb6b5a1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Show an editor info bar when multiple highlight definitions can be found
for a single file or mime type. Add a combo box to the info that allows
the user to choose between them.
Change-Id: I07278d065e19d4e04fba24a6d789c8b6c9f55d60
Reviewed-by: Eike Ziller <eike.ziller@qt.io>