diff --git a/examples/example2 b/examples/example2 index 0d88da9..109f910 100755 Binary files a/examples/example2 and b/examples/example2 differ diff --git a/examples/example2.cpp b/examples/example2.cpp index a26b0d4..8990b86 100644 --- a/examples/example2.cpp +++ b/examples/example2.cpp @@ -8,7 +8,7 @@ int main(void) { int num = 5; const char* str = "My number is"; - pcprintf("|40%s %d|39\n", str, num); + pcprintf("|40%s |05%d|39\n", str, num); return 0; } \ No newline at end of file diff --git a/libpipecolors.cpp b/libpipecolors.cpp index 5b785ca..64e4937 100644 --- a/libpipecolors.cpp +++ b/libpipecolors.cpp @@ -83,14 +83,16 @@ namespace pipecolors { while(regex_search(start, end, match, re, flags)) { - if(colors[match[0]].empty()) continue; + //while ((index = s.find(match[0])) != std::string::npos) //{ - if(has_colors()) { + if(has_colors() && !colors[match[0]].empty()) { + //if(colors[match[0]].empty()) continue; s.replace(s.find(match[0]), match[0].length(), colors[match[0]]); } else { + //if(colors[match[0]].empty()) continue; s.erase(s.find(match[0]), match[0].length()); } //}