Skip to content
/ Pe Public
forked from HaikuArchives/Pe

Commit

Permalink
Diff_Language: add detection of "Subject" lines on patchset files.
Browse files Browse the repository at this point in the history
This comes in handy for Haikuporter's .patchset files, as each
individual commit "Subject" gets used as a separator in the function
popup.
  • Loading branch information
OscarL authored and waddlesplash committed Dec 14, 2022
1 parent ef14220 commit d51ea0e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Languages/Sources/Diff_Language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,15 @@ ScanForFunctions(CLanguageProxy& proxy)
// -2 in order to skip back over '@@'
proxy.SetNestLevel(1);
proxy.AddFunction(displayLine.String(), matchLine.String(), pos-text, false);
} else if (strncmp(pos, "Subject: ", 9) == 0) {
const char* lineEnd = strchr(pos, '\n');
if (!lineEnd)
lineEnd = pos + strlen(pos);
pos += 9; // Leave out "Subject: "
BString patchSubject(pos, lineEnd-pos);
proxy.AddSeparator(patchSubject);
}

if ((pos = strchr(pos+1, '\n')) != NULL)
pos++;
}
Expand Down

0 comments on commit d51ea0e

Please sign in to comment.