Add a separate BASENAME bit to distinguish from the FILENAME bit.
When BASENAME is active show the base filename in the filename column.
When FILENAME is active show the whole path for each filename. Cycle
through the three modes with toggle_filename() still. Note that we are
never in both FILENAME and BASENAME mode.
The user can cycle through the three modes by pressing the hotkey an
extra time. First press shows the basename, second press shows the full
path (filename), and the third press hides the filename column again.
Display the basename instead of the whole path for each file when
the filename column is displayed. Make the column the same width all
the time, taking the maximum basename width of all loaded files and
padding with spaces.
Also fix the attributes when the filename column is displayed. Insert
the correct filename-matching color for as many characters as we add for
the filename column. Use the full filename when looking up the color
because we don't want files in different paths to have the same color,
and we don't want the color to change based on whether we are displaying
the base or the whole filename.
Mostly addresses #277. I won't claim it fully closes it, because there
are at least two ways it could be improved:
1. It doesn't draw a nice coloured divider in the column after the
filename, and that would provide maximum visual clarity and
consistency with the existing presentation.
2. It would be nice if the filenames weren't shown on every single line,
but only on the first line of a contiguous chunk of log lines from a
single file (or on the top line of the screen if the first line of
the chunk was already scrolled off the top).
3. It doesn't yet include the filename in the text copied to the
clipboard when the 'c' hotkey is pressed.
This change adds back support for line scrubbing and
adds a column that displays the time offset from
different points in the file. Also, try to handle
deleted files by dropping their lines from the display
view.
* help.txt: Update the help text for the new features.
* lnav.cc: Add scrub/time-offset key bindings. Also
added some more comments and added some handling for
deleted files.
* log_format_impls.cc: Add scrubbing for the generic
log format that shortens timestamps and RDNS strings.
* logfile_sub_source.cc: Add a time-offset column to
the display.
* textview_curses.cc: Some cleanup.
* grep_proc.cc: When a request is queued with the start line
== -1, we need to start searching from the highest line
ever seen and not the last line processed.
* line_buffer.cc: If a partial line was read, we need to
avoid returning another line if more data is appended
to the file.
* lnav.cc: Accept file name patterns on the command-line that
don't match any files yet. Initialize the screen before
redirecting stderr to the log file or /dev/null.
* log_format.hh: Add some comments. Start to add back support
for scrubbing.
* logfile_sub_source.cc: Move scrubbing to the format impl.
* textview_curses.hh: Add comments.