mike-ward / VSColorOutput

Color highlighting to Visual Studio's Build and Debug Output Windows
MIT License
430 stars 93 forks source link

Req: Multi-line regex #65

Closed jamespharvey20 closed 4 years ago

jamespharvey20 commented 7 years ago

I'm using Catch for unit testing. Upon a requirement failure, it prints something like:

  REQUIRE( a == b )
with expansion:
  4 == 5

I'd like to be able to colorize the last line. I tried a RegExPattern of with expansion:\n.* which didn't grab it, so I'm thinking it looks at each line separately. If implemented, I'm thinking the regex matching would default to going line by line, and only looking multiline when encountering \n. So x.* wouldn't start grab multi lines.

I acknowledge this might be something you don't want to do, if it would require a ton of changes.

mike-ward commented 7 years ago

Colorizing in the Visual Studio output window is done a line at a time as the data comes in. It's not like an edit window where you have access to the whole buffer with scroll offsets. There would have to be some kind of a state machine that understood the meaning of what was displayed to know that the last line to highlight was part of an earlier expression. And even then you could only color the current part of the expression being examined, not earlier parts.