sandrocardoso86 / webgrind

Automatically exported from code.google.com/p/webgrind
Other
0 stars 0 forks source link

index.php?op=fileviewer&file= some times show wrong code #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
v0.71

If line has very big width right <code> block (with source) drops down, 
but not float to left <code> block (with lines numbers).

Please, use table instand float block ^___^

Original issue reported on code.google.com by dmiFedorenko on 19 Jun 2008 at 12:24

Attachments:

GoogleCodeExporter commented 8 years ago
Browser: Firefox 3.

Original comment by dmiFedorenko on 19 Jun 2008 at 12:26

GoogleCodeExporter commented 8 years ago
Good point! 

We would need to either scrap the highlighter or do it without 
`highlight_file()` as it wont show line numbers.

Original comment by gugakf...@gmail.com on 19 Jun 2008 at 7:56

GoogleCodeExporter commented 8 years ago
Mmmmmm... What about other html? Not blocks but table? I fink it will helps.
I can try to do this if u need :)

Original comment by dmiFedorenko on 19 Jun 2008 at 9:50

GoogleCodeExporter commented 8 years ago
I gave it another look and think I've improved the display in r100. 
It's not perfect, but it does break lines a bit better.

Original comment by gugakf...@gmail.com on 19 Jun 2008 at 10:59

GoogleCodeExporter commented 8 years ago
Thanks.

Just a bit suggestions, how I make it (check attache):
1. I dont show whole file, but only a part with needed string (-/+10 lines).
2. I use common div container with "overflow-x: auto; white-space: nowrap" 
style. 
Vertical scroll will showing in worst. Ie 6 dont know "overflow-x".
3. I get whole file, then slip it to array
    $strings = highlight_string(file_get_contents($errfile), true);
    $strings = explode("<br />", $strings);
   then I add number to the begining of each line
    $begin = ($errline-10) >= 0 ? $errline-10 : 0;
    foreach($strings as $l => &$string) $string = "<span class=l>".($l+1)."</
span>".$string; 
    $strings[$errline-1] = '<i id=sl>'.$strings[$errline-1].' <span id=er><-- '.
$errstr."</span></i>";
    $strings = join("<br />", array_slice($strings, $begin, 20));
    $log .= "<div id=source>$strings</div>";

Whats all :)
The code what do this is quity simple :)

Original comment by dmiFedorenko on 20 Jun 2008 at 5:38

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the suggestions. I believe the issue to be fixed in r105.

Original comment by gugakf...@gmail.com on 20 Jun 2008 at 10:12

GoogleCodeExporter commented 8 years ago
Ok, thanks.

Original comment by dmiFedorenko on 21 Jun 2008 at 11:38