Show relative paths in diff filename tags.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3951 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2009-07-10 15:57:12 +00:00
parent a6a847f4e7
commit 746a8d5834
2 changed files with 36 additions and 26 deletions

View File

@ -5,6 +5,8 @@
scrolling with the arrow keys.
* src/keybindings.c, src/keybindings.h, src/search.c, src/search.h:
Add 'Mark All' keybinding.
* tagmanager/diff.c:
Show relative paths in diff filename tags.
2009-07-09 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>

View File

@ -43,13 +43,17 @@ static void findDiffTags (void)
while ((line = fileReadLine ()) != NULL)
{
const unsigned char* cp = line;
boolean skipSlash = TRUE;
boolean skipSlash = FALSE;
if (strncmp((const char*) cp, "--- ", (size_t) 4) == 0)
{
cp += 4;
if (isspace ((int) *cp)) continue;
/* strip any absolute path */
if (*cp == '/' || *cp == '\\')
{
skipSlash = TRUE;
tmp = (const unsigned char*) strrchr((const char*) cp, '/');
if (tmp == NULL)
{ /* if no / is contained try \ in case of a Windows filename */
@ -63,6 +67,10 @@ static void findDiffTags (void)
}
}
}
}
else
tmp = cp;
if (tmp != NULL)
{
if (skipSlash) tmp++; /* skip the leading slash or backslash */