diff --git a/src/Whoops/Exception/Frame.php b/src/Whoops/Exception/Frame.php index 5aecd37..dc1ae93 100644 --- a/src/Whoops/Exception/Frame.php +++ b/src/Whoops/Exception/Frame.php @@ -58,7 +58,9 @@ class Frame implements Serializable if ($shortened && is_string($file)) { // Replace the part of the path that all frames have in common, and add 'soft hyphens' for smoother line-breaks. $dirname = dirname(dirname(dirname(dirname(dirname(dirname(__DIR__)))))); - $file = str_replace($dirname, "…", $file); + if ($dirname !== '/') { + $file = str_replace($dirname, "…", $file); + } $file = str_replace("/", "/", $file); } diff --git a/src/Whoops/Resources/css/whoops.base.css b/src/Whoops/Resources/css/whoops.base.css index 7c11d52..4c1ef71 100644 --- a/src/Whoops/Resources/css/whoops.base.css +++ b/src/Whoops/Resources/css/whoops.base.css @@ -171,7 +171,6 @@ header { .frame-file { font-family: "Inconsolata", "Fira Mono", "Source Code Pro", Monaco, Consolas, "Lucida Console", monospace; - word-wrap: break-word; color: #a29d9d; } @@ -257,6 +256,10 @@ header { color: white; } +.delimiter { + display: inline-block; +} + .data-table-container label { font-size: 16px; color: #303030; diff --git a/src/Whoops/Resources/views/frame_code.html.php b/src/Whoops/Resources/views/frame_code.html.php index 9bd1973..7505087 100644 --- a/src/Whoops/Resources/views/frame_code.html.php +++ b/src/Whoops/Resources/views/frame_code.html.php @@ -10,10 +10,10 @@ getEditorHref($filePath, (int) $line)): ?> Open: getEditorAjax($filePath, (int) $line) ? ' data-ajax' : '') ?>> - escape($filePath ?: '<#unknown>') ?> + breakOnDelimiter('/', $tpl->escape($filePath ?: '<#unknown>')) ?> - escape($filePath ?: '<#unknown>') ?> + breakOnDelimiter('/', $tpl->escape($filePath ?: '<#unknown>')) ?> " id="frame-line-">