This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 162874 [details] example.png Netbeans isn't recognizing error lines in the output window in the following cases: gcc -fdiagnostics-color=always g++ -fdiagnostics-color=always clang -fcolor-diagnostics clang++ -fcolor-diagnostics If color diagnostics is turned off, clicking on "file.c:23: error: ..." in the output window focuses file.c and moves the caret to line 23. ---- An alternative solution is to use -fdiagnostics-color=auto instead of -fdiagnostics-color=always
Output window ignores output listener in colored line.
It looks like method OutWriter.print(CharSequence s, OutputListener l, boolean important, Color c, Color b, OutputKind outKind, boolean addLS) is wrong. It should pass listener to the method doWrite().
Created attachment 164021 [details] proposed patch
The patch looks very good to me. I have only one minor comment regarding changes in AbstractLines.java: Isn't this: info.addSegment(endPos - trailingCnt, outKind, l, c, b, important); if (trailingCnt > 0) { // have to underline all trailing spaces (we cannot know if there are more segments) info.addSegment(endPos, outKind, l, c, b, important); } The same as: info.addSegment(endPos, outKind, l, c, b, important); I.e. only one segment instead of two segments with the same listener and colors. Is it necessary start underlining the trailing whitespace? Using the current behavior (adding "empty" segment with no listener and colors) doesn't work with your changes? (I'm not saying it's wrong, I'm just curious.) Thank you very much for fixing this!
(In reply to Jaroslav Havlin from comment #4) > The patch looks very good to me. > > I have only one minor comment regarding changes in AbstractLines.java: > > Isn't this: > > info.addSegment(endPos - trailingCnt, outKind, l, c, b, important); > if (trailingCnt > 0) { > // have to underline all trailing spaces (we cannot know if there are > more segments) > info.addSegment(endPos, outKind, l, c, b, important); > } > > The same as: > > info.addSegment(endPos, outKind, l, c, b, important); Yes. it is the same. The better solution is skip trailing spaces only in last segment. But there is no way to understand that it is last segment. For example colored message: welcome.cc:10:9: error: 'argc' was not declared in this scope has segments: - "welcome.cc:10:9:" - " " - "error: " - "'argc' was not declared in this scope" with 3 colors. If we do not underline trailing spaces, IDE interrupts underline after "error:". If we do not underline leading spaces, IDE interrupts underline after "welcome.cc:10:9:". Fortunately we can skip leading spaces for first segment. > > I.e. only one segment instead of two segments with the same listener and > colors. > > Is it necessary start underlining the trailing whitespace? Using the current > behavior (adding "empty" segment with no listener and colors) doesn't work > with > your changes? > (I'm not saying it's wrong, I'm just curious.) > > Thank you very much for fixing this!
I understand now. Thank you, great job.
fixed in enum, branch release82, changeset d2a0b3f48daf
Integrated into 'main-silver', will be available in build *201704110002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/1d81d1443e1e User: Alexander Simon <alexvsimon@netbeans.org> Log: fixed Bug #268941 Missing support for gcc -fdiagnostics-color=always in output window (transplanted from d2a0b3f48dafbf0772038c0cb7fa8a95bcbcf2a6)
https://netbeans.org/bugzilla/show_bug.cgi?id=268941 Changesets: http://hg.netbeans.org/releases/rev/d2a0b3f48daf # fixed Bug #268941 Missing support for gcc -fdiagnostics-color=always in output window
I see the patch will be in Netbeans 8.2 Patch 2. Thanks!