diff --git a/ncurses/ncurses.php b/ncurses/ncurses.php index 19aa919..2cc6e27 100644 --- a/ncurses/ncurses.php +++ b/ncurses/ncurses.php @@ -94,9 +94,10 @@ class NcWindow { } function write( $y, $x, $text, $update = true ) { $y = $y < 0 ? $this->height + $y : $y; - $x = $x < 0 ? $this->width + $x: $x; + $x = $x < 0 ? $this->width + $x : $x; $lines = preg_split( '/\r?(\n|\r)/', $text ); foreach( $lines as $id => $line ) { + $line = substr( $line, 0, $this->width - $x ); ncurses_mvwaddstr( $this->window, $y + $id, $x, $line ); } if( $update ) { diff --git a/scanner.php b/scanner.php index ff9133c..66be9bb 100644 --- a/scanner.php +++ b/scanner.php @@ -294,7 +294,7 @@ if( $curses ) { ); $nc_faults = new NcTableView( $nc_main, -5, 0, 4, 0, array( 'columns' => $nc_faults_columns ) ); $nc_faults->title( 'Faults' ); - $nc_main->write( -1, 0, '[Q] Quit | [Return] Fault Info' ); + $nc_main->write( -1, 0, '[Q] Quit | [S] Save Output file | [Return] Fault Info' ); } // Dig into the modules folder and load up what we find @@ -365,6 +365,7 @@ if( $curses ) { $nc_fault_info->write_centered( 0, 'Fault Information' ); $nc_fault_info->write( 3, 0, "Module:\nLevel:\nFilename:\nLine Number:\nAuthor:\nRevision:\nReason:\n\nContext:" ); $nc_fault_info->attribute_off( NCURSES_A_BOLD ); + $fault['object']['context'] = trim( $fault['object']['context'] ); $nc_fault_info->write( 3, 20, "{$fault['module']}\n{$fault['level']}\n{$fault['file']}\n{$fault['line']}\n{$fault['author']}\n{$fault['revision']}\n{$fault['reason']}\n\n{$fault['object']['context']}" ); $nc_fault_info->get_char(); $nc_fault_info->hide();