@@ -1229,40 +1229,22 @@ namespace {
1229
1229
// --------------------------------------------------------------------------
1230
1230
// Remove "Line 123: " prefix from hit line (UTF‑16)
1231
1231
// --------------------------------------------------------------------------
1232
- std::wstring stripHitPrefix (const std::wstring& w)
1233
- {
1232
+ std::wstring stripHitPrefix (const std::wstring& w) {
1234
1233
size_t i = 0 ;
1235
1234
1236
- // 1. Skip leading whitespace (indentation).
1237
- while (i < w.size () && iswspace (w[i]))
1238
- ++i;
1239
-
1240
- // 2. Skip an optional alphabetic word such as "Line", "Zeile", etc.
1241
- while (i < w.size () && iswalpha (w[i]))
1242
- ++i;
1243
-
1244
- // 3. Skip one single space after that word, if present.
1245
- if (i < w.size () && w[i] == L' ' )
1246
- ++i;
1235
+ while (i < w.size () && iswspace (w[i])) ++i; // leading WS
1236
+ while (i < w.size () && iswalpha (w[i])) ++i; // "Line", "Zeile", …
1237
+ if (i < w.size () && w[i] == L' ' ) ++i; // single space
1247
1238
1248
- // 4. Consume at least one digit (line number).
1249
1239
size_t digitStart = i;
1250
- while (i < w.size () && iswdigit (w[i]))
1251
- ++i;
1252
- if (i == digitStart || i >= w.size ())
1253
- return w; // Not our format – return unchanged.
1254
-
1255
- // 5. Expect exactly one colon.
1256
- if (w[i] != L' :' )
1257
- return w; // Not our format – return unchanged.
1258
- ++i;
1240
+ while (i < w.size () && iswdigit (w[i])) ++i; // digits
1241
+ if (i == digitStart || i >= w.size ()) return w; // no digits → bail
1259
1242
1260
- // 6. Skip whitespace after the colon.
1261
- while (i < w.size () && iswspace (w[i]))
1262
- ++i;
1243
+ if (w[i] != L' :' ) return w; // must be ':'
1244
+ ++i;
1263
1245
1264
- // 7. Return the remainder: the actual hit text.
1265
- return w.substr (i);
1246
+ while (i < w. size () && iswspace (w[i])) ++i; // WS after ':'
1247
+ return w.substr (i); // remainder = hit
1266
1248
}
1267
1249
1268
1250
// --------------------------------------------------------------------------
0 commit comments