Commit Graph

1319 Commits

Author SHA1 Message Date
Phil Hord
eee7d0ddfc Squash a bunch of signed/unsigned warnings 2018-03-29 10:49:38 -07:00
Phil Hord
5a20829ed4 dynamic exception specifications are deprecated in C++11
Remove exception specifications to appease modern compilers and reduce
warning counts.

I sort of hate to remove all these exception-decls, but they are in fact
deprecated, and my compiler loves to complain.
2018-03-29 10:43:44 -07:00
Phil Hord
121be1a558 Add updated definition to squash warning
_BSD_SOURCE is deprecated and using it emits warnings unless you also
define _DEFAULT_SOURCE. Let's define _DEFAULT_SOURCE.
2018-03-29 10:20:20 -07:00
Timothy Stack
87cbab1ac3 [index] do a full sort if new lines have a timestamp before the last indexed 2018-03-29 07:32:57 -07:00
Timothy Stack
ef34a6aaaf [search] display lines matching the search in preview instead of jumping to the first
Jumping around can be disruptive, instead show matches in
the preview window.
2018-03-28 07:25:10 -07:00
Timothy Stack
36932b148d [hotkeys] cleanup the last commit 2018-03-28 05:35:37 -07:00
Timothy Stack
8257f188cb [hotkeys] change the filename hotkey to left/right arrow 2018-03-27 22:11:57 -07:00
Tim Stack
4760765c1d
Merge pull request #507 from phord/toggle-filenames
Toggle filenames attribute fixes
2018-03-27 21:08:30 -07:00
Phil Hord
95e294decb fix failing unit test
The help output changed with the toggle-filenames option, but
the test for help wasn't updated.

Maybe the help needs to be updated a bit to include the two
filename column modes, now that I think about it.  But we should
discuss the merits of that first, I suppose.
2018-03-27 16:36:57 -07:00
Phil Hord
4d4ac9b8b0 Add another filename mode to show file path
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.
2018-03-27 16:07:56 -07:00
Phil Hord
81974c6bdc Fix filename column width and attributes
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.
2018-03-27 16:07:56 -07:00
Adam Spiers
9ffbc1ac46 make '.' toggle prefixing each log line with 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.
2018-03-27 16:07:56 -07:00
Adam Spiers
47a7b5ce02 fix std::remove call in path.h
It's trying to use std::remove from cstdio.  Apparently path.h isn't
currently used for anything, since it didn't even compile ...
2018-03-27 16:07:56 -07:00
Tim Stack
09e7e14167
Merge pull request #506 from phord/master
string2level uses wrong string length
2018-03-27 10:11:22 -07:00
Phil Hord
4d1d782007 string2level uses wrong string length
It should pass only the matched length, not the original string length.
Caught by -fsanitize=address while trying to parse "some string (DEBUG)"
Probaby deserves a unit test.
2018-03-27 09:44:04 -07:00
Timothy Stack
9e8efae48e [vt52] add mapping for KEY_HOME if it's not found
Fixes #501
2018-03-26 21:35:18 -07:00
Timothy Stack
ebf20a746b [commands] fix completion for delete-filter 2018-03-26 08:03:32 -07:00
Timothy Stack
88a192aeeb [line_buffer] if the size of the file is known, reduce the requested buffer size and ignore attempts to shrink the buffer 2018-03-25 23:36:18 -07:00
Timothy Stack
fe6781d3e8 [reltime] support milliseconds when specifying a partial absolute time
Fixes #499
2018-03-23 07:09:50 -07:00
Timothy Stack
4694cabd05 update year 2018-03-23 06:45:09 -07:00
Tim Stack
faf47ca041
Merge pull request #496 from phord/master
Replace mkstemp with std::tmpfile
2018-03-15 20:54:11 -07:00
Tim Stack
e9c9d8ba51
Merge pull request #487 from mterron/patch-1
Fix comparison between signed and unsigned int
2018-03-15 20:50:17 -07:00
Phil Hord
1ae4a04e42 Replace mkstemp with std::tmpfile
TMPDIR is not always defined in the environment but the code doesn't check
for that. Let's used std::tmpfile instead.

Maybe an easier fix is to perform the tmpdir lookup better, but that is
also noisy since the search for a decent tmpdir is based on lore.

std::tmpfile() is rather clean. However it does not leave a nice filename
name around for debugging, so I understand why it might not be preferred.

Fixes #495
2018-03-13 19:36:03 -07:00
Timothy Stack
352d16f4cf [line-buffer] fix resize to use the requested size
When reading in a full message, we need to make sure the buffer
is large enough to accommodate the full thing.
2018-03-02 09:17:49 -08:00
Terror
794595fde1
Fix comparison between signed and unsigned int
Fixes warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
2018-02-20 09:44:08 +13:00
Timothy Stack
8f3af33792 add some NEWS 2018-02-11 22:11:01 -08:00
Timothy Stack
339b5bfd82 add author 2018-02-11 22:03:01 -08:00
Timothy Stack
7f99955cbc [misc] fix a perf issue when previewing commands and some sql fixes 2018-02-07 11:06:59 -08:00
Timothy Stack
7d7060ae4c [generic_log] fix recognition for generic logs
The generic format picks up extra text in the timestamp, which
caused the date time scanner to reject some matches.  I think
it's okay to allow for some trailing junk, so it no longer
ensures the size of the match is the same as the input.
2018-02-04 22:21:18 -08:00
Timothy Stack
74f24fcf4c bump version numbers 2018-01-23 20:17:38 -08:00
Timothy Stack
332fa39145 [release] bump some version numbers 2018-01-22 11:06:39 -08:00
Timothy Stack
bdcfc5cfdd [misc] rounding some corners 2018-01-08 10:03:11 -08:00
Timothy Stack
75ccb8ca4f [layout] fix a crash with a small window 2018-01-07 22:17:27 -08:00
Timothy Stack
a6d4563d7d [build] missing header 2017-12-29 07:02:19 -08:00
Timothy Stack
74b58ed9fc [highlights] allow the highlight color to be specified in log formats
Defect Number:
    Reviewed By:
   Testing Done:
2017-12-29 06:51:09 -08:00
Tim Stack
095bcbd419
Merge pull request #482 from salvadom/master
Added used time formats
2017-12-28 09:56:59 -08:00
Medina Maza
b4152056af Added time format for day month year hour:minutes:seconds and optional millis 2017-12-17 22:01:50 -08:00
Timothy Stack
4b40b3f9f5 [date-time] add a formatter for 0x0p+0
Defect Number:
    Reviewed By:
   Testing Done:
2017-12-07 06:36:12 -08:00
Tim Stack
3da74b5621
[build] try to fix the windows build
I think this should fix the failure to find asprintf.  But, the resulting binary fails on startup...
2017-12-04 13:25:36 -08:00
Timothy Stack
b5f5b4137c [search] redo search after filtering
Fixes #480
2017-12-04 08:52:40 -08:00
Timothy Stack
f25980df03 [ui] rework the default colors change
The default colors change resulted in some parts of the lnav
UI being colored incorrectly.  I've reworked it a bit so that
the ansi color pairs are preserved and the default colors are
only used with the color pairs for roles.  I've also replaced
references to ansi colors with roles in a few places to make
things work consistently.
2017-12-02 22:11:34 -08:00
Timothy Stack
5d2dffad35 [cmd] redo deleting command-prompt char should exit prompt
My first attempt at this wasn't right and would exit the prompt
when an escape sequence was received and the prompt was empty
(like going back through history).
2017-11-05 21:19:46 -08:00
Tim Stack
336b3d9945
Merge pull request #478 from sureshsundriyal/openbsd
Fix lnav builds on OpenBSD
2017-10-31 14:24:55 -07:00
Suresh Sundriyal
4483722b1d Fix the __clang__ macro. 2017-10-28 16:10:03 -07:00
Suresh Sundriyal
060a437754 Fix the filedesciptior assignment 2017-10-28 15:52:06 -07:00
Suresh Sundriyal
217d365672 Redefine _WCHAR_H_CPLUSPLUS_98_CONFORMANCE_ only on OpenBSD 2017-10-28 15:11:15 -07:00
Suresh Sundriyal
1a7e2fee9b Redefine _WCHAR_H_CPLUSPLUS_98_CONFORMANCE_ only if needed. 2017-10-28 14:26:35 -07:00
Suresh Sundriyal
72f3d7951b Don't redefine rl_completer_word_break_characters 2017-10-28 13:26:29 -07:00
Suresh Sundriyal
23c1f7ba4f [OpenBSD] Define _WCHAR_H_CPLUSPLUS_98_CONFORMANCE_ only when using Clang. 2017-10-28 13:17:54 -07:00
Suresh Sundriyal
0c88eeeb07 Fix lnav builds on OpenBSD.
* Remove all the wordexp related unused headers and code.
* stdout does not appear to be reassignable on OpenBSD.
* defining _WCHAR_H_CPLUSPLUS_98_CONFORMANCE_ seems to fix the const
  correctness related redefinitions between wchar.h imported from
  the system libc and the one imported by clang++ STL.
2017-10-28 05:21:02 -07:00