> Sounds reasonable to me, can you submit a patch (I think for editor.h
> and highlighting.c but do check if anything else is needed).
I have attached some patch, I hope it is enough.
> PS and if you want to add the ability for the standard system to have
> another regex for differentiating warnings from errors that would be
> even cooler, but a lot more work.
Do you have in mind building? From what I saw in code (mind I don't
build anything usually, I am mostly Python programmer and if I build I
just run make from the terminal), the red indicator is used to mark
some errors in code. I understand that Geany parses output of the
compiler and sets indicators in proper places? So I could also try to
parse warnings in the compiler output and set those indicators there?
--
Filip Gruszczyński
diff --git a/src/editor.h b/src/editor.h
index 9ecbb05..9312eeb 100644
--- a/src/editor.h
+++ b/src/editor.h
@@ -75,6 +75,8 @@ typedef enum
{
/** Indicator to highlight errors in the document text. This is a red squiggly underline. */
GEANY_INDICATOR_ERROR = 0,
+ /** Indicator to highlight warnings in the document text. This is a yellow squiggly underline. */
+ GEANY_INDICATOR_WARNING = 1,
/** Indicator used to highlight search results in the document. This is a
* rounded box around the text. */
/* start container indicator outside of lexer indicators (0..7), see Scintilla docs */
diff --git a/src/highlighting.c b/src/highlighting.c
index f327b25..4a827d8 100644
--- a/src/highlighting.c
+++ b/src/highlighting.c
@@ -665,6 +665,10 @@ static void styleset_common(ScintillaObject *sci, filetype_id ft_id)
/* Error indicator */
SSM(sci, SCI_INDICSETSTYLE, GEANY_INDICATOR_ERROR, INDIC_SQUIGGLE);
SSM(sci, SCI_INDICSETFORE, GEANY_INDICATOR_ERROR, invert(rotate_rgb(0xff0000)));
+
+ /* Warning indicator */
+ SSM(sci, SCI_INDICSETSTYLE, GEANY_INDICATOR_WARNING, INDIC_SQUIGGLE);
+ SSM(sci, SCI_INDICSETFORE, GEANY_INDICATOR_WARNING, invert(rotate_rgb(0xffff00)));
/* Search indicator, used for 'Mark' matches */
SSM(sci, SCI_INDICSETSTYLE, GEANY_INDICATOR_SEARCH, INDIC_ROUNDBOX);
_______________________________________________
Geany mailing list
[email protected]
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany