From 4137e993d11e926ae28343c1eeac1a46977efd47 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Tue, 14 Jul 2015 08:05:03 +0200 Subject: jump to correct hash after renaming a file --- www/edit.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'www/edit.php') diff --git a/www/edit.php b/www/edit.php index e7e6fbc..1ced7b6 100644 --- a/www/edit.php +++ b/www/edit.php @@ -22,7 +22,14 @@ $repopo = new Repository_Post($repo); if ($repopo->process($_POST, $_SESSION)) { $anchor = ''; if ($file instanceof File) { - $anchor = '#' . $file->getAnchorName(); + if (isset($repopo->renameMap[$file->getFilename()])) { + $anchor = '#' + . $repo->getFileByName( + $repopo->renameMap[$file->getFilename()] + )->getAnchorName(); + } else { + $anchor = '#' . $file->getAnchorName(); + } } else if ($file === 'newfile' && $repopo->newfileName) { $anchor = '#' . $repo->getFileByName($repopo->newfileName)->getAnchorName(); } -- cgit v1.2.3