mirror of
https://github.com/tstack/lnav.git
synced 2024-08-17 00:40:30 +03:00
[hotkeys] change the filename hotkey to left/right arrow
This commit is contained in:
parent
4760765c1d
commit
8257f188cb
11
NEWS
11
NEWS
@ -1,4 +1,15 @@
|
||||
|
||||
lnav v0.8.4:
|
||||
Features:
|
||||
* Pressing left-arrow while viewing log messages will reveal the source
|
||||
file name for each line. Pressing again will reveal the full path.
|
||||
|
||||
Fixes:
|
||||
* The HOME key should now work in the command-prompt and move the cursor
|
||||
to the beginning of the line.
|
||||
* The :delete-filter command should now tab-complete existing filters.
|
||||
* Milliseconds can now be used in relative times (e.g. 10:00:00.123)
|
||||
|
||||
lnav v0.8.3:
|
||||
Features:
|
||||
* Support for the Bro Network Security Monitor (https://www.bro.org) log
|
||||
|
@ -70,7 +70,9 @@ Spatial Navigation
|
||||
* - |ks| h |ke|
|
||||
- |ks| ← |ke|
|
||||
-
|
||||
- Left half a page
|
||||
- Left half a page. In the log view, pressing left while at the start of
|
||||
the message text will reveal the source file name for each line.
|
||||
Pressing again will reveal the full path.
|
||||
* - |ks| Shift |ke| + |ks| h |ke|
|
||||
- |ks| Shift |ke| + |ks| ← |ke|
|
||||
-
|
||||
@ -209,8 +211,6 @@ Display
|
||||
log_line column
|
||||
* - |ks| p |ke|
|
||||
- Toggle the display of the log parser results
|
||||
* - |ks| . |ke|
|
||||
- Toggle the display of the log file names
|
||||
* - |ks| Tab |ke|
|
||||
- Cycle through colums to graph in the SQL result view
|
||||
* - |ks| Ctrl |ke| + |ks| l |ke|
|
||||
|
13
src/help.txt
13
src/help.txt
@ -119,8 +119,10 @@ the file where warnings or errors are detected by coloring the bar
|
||||
yellow or red, respectively. Tick marks will also be added to the
|
||||
left and right hand side of the bar, for search hits and bookmarks.
|
||||
|
||||
When multiple files are open, a bar on the left side is color coded and
|
||||
broken up to indicate which messages are from the same file.
|
||||
A bar on the left side is color coded and broken up to indicate which
|
||||
messages are from the same file. Pressing the left-arrow or 'h' will
|
||||
reveal the source file names for each message and pressing again will
|
||||
show the full paths.
|
||||
|
||||
When at the bottom of the log view, a summary line will be displayed on the
|
||||
right-hand-side to give you some more information about your logs, including:
|
||||
@ -190,7 +192,9 @@ Spatial Navigation
|
||||
b/bs/pgup Move up a page.
|
||||
j/cr/down-arrow Move down a line.
|
||||
k/up-arrow Move up a line.
|
||||
h/left-arrow Move to the left.
|
||||
h/left-arrow Move to the left. In the log view, moving left will reveal
|
||||
the source log file names for each line. Pressing again
|
||||
will reveal the full path.
|
||||
l/right-arrow Move to the right.
|
||||
H/Shift+left Move to the left by a smaller increment.
|
||||
L/Shift+right Move to the right by a smaller increment.
|
||||
@ -295,9 +299,6 @@ Display options
|
||||
means it has sped up. You can use the "s/S" hotkeys to
|
||||
scan through the slow downs.
|
||||
|
||||
. In the log view, toggle the display of filenames showing
|
||||
where each log line comes from.
|
||||
|
||||
i View/leave a histogram of the log messages over
|
||||
time. The histogram counts the number of
|
||||
displayed log lines for each bucket of time. The
|
||||
|
@ -985,11 +985,6 @@ void handle_paging_key(int ch)
|
||||
tc->reload_data();
|
||||
break;
|
||||
|
||||
case '.':
|
||||
lnav_data.ld_log_source.toggle_filename();
|
||||
tc->reload_data();
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
if (toggle_view(&lnav_data.ld_views[LNV_HISTOGRAM])) {
|
||||
lnav_data.ld_rl_view->set_alt_value(
|
||||
|
27
src/lnav.cc
27
src/lnav.cc
@ -1836,6 +1836,33 @@ static void handle_key(int ch) {
|
||||
if (lnav_data.ld_mode == LNM_PAGING) {
|
||||
if (!lnav_data.ld_view_stack.empty()) {
|
||||
textview_curses *tc = lnav_data.ld_view_stack.back();
|
||||
logfile_sub_source *lss = NULL;
|
||||
|
||||
lss = dynamic_cast<logfile_sub_source *>(tc->get_sub_source());
|
||||
|
||||
if (lss != nullptr) {
|
||||
switch (ch) {
|
||||
case 'h':
|
||||
case 'H':
|
||||
case KEY_SLEFT:
|
||||
case KEY_LEFT:
|
||||
if (tc->get_left() == 0) {
|
||||
lss->increase_line_context();
|
||||
tc->set_needs_update();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 'l':
|
||||
case 'L':
|
||||
case KEY_SRIGHT:
|
||||
case KEY_RIGHT:
|
||||
if (lss->decrease_line_context()) {
|
||||
tc->set_needs_update();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (tc->handle_key(ch)) {
|
||||
return;
|
||||
|
@ -97,19 +97,38 @@ public:
|
||||
this->clear_line_size_cache();
|
||||
};
|
||||
|
||||
void toggle_filename(void) {
|
||||
// NONE -> F_BASENAME -> F_FILENAME -> NONE ...
|
||||
if (this->lss_flags & F_BASENAME) {
|
||||
// F_BASENAME -> F_FILENAME
|
||||
this->lss_flags ^= F_BASENAME | F_FILENAME;
|
||||
} else if (this->lss_flags & F_FILENAME) {
|
||||
// F_FILENAME -> NONE
|
||||
this->lss_flags ^= F_FILENAME;
|
||||
void increase_line_context(void) {
|
||||
long old_flags = this->lss_flags;
|
||||
|
||||
if (this->lss_flags & F_FILENAME) {
|
||||
// Nothing to do
|
||||
} else if (this->lss_flags & F_BASENAME) {
|
||||
this->lss_flags &= ~F_NAME_MASK;
|
||||
this->lss_flags |= F_FILENAME;
|
||||
} else {
|
||||
// NONE -> F_BASENAME
|
||||
this->lss_flags ^= F_BASENAME;
|
||||
this->lss_flags |= F_BASENAME;
|
||||
}
|
||||
this->clear_line_size_cache();
|
||||
if (old_flags != this->lss_flags) {
|
||||
this->clear_line_size_cache();
|
||||
}
|
||||
};
|
||||
|
||||
bool decrease_line_context(void) {
|
||||
long old_flags = this->lss_flags;
|
||||
|
||||
if (this->lss_flags & F_FILENAME) {
|
||||
this->lss_flags &= ~F_NAME_MASK;
|
||||
this->lss_flags |= F_BASENAME;
|
||||
} else if (this->lss_flags & F_BASENAME) {
|
||||
this->lss_flags &= ~F_NAME_MASK;
|
||||
}
|
||||
if (old_flags != this->lss_flags) {
|
||||
this->clear_line_size_cache();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
void set_time_offset(bool enabled) {
|
||||
@ -523,6 +542,8 @@ private:
|
||||
F_TIME_OFFSET = (1L << B_TIME_OFFSET),
|
||||
F_FILENAME = (1L << B_FILENAME),
|
||||
F_BASENAME = (1L << B_BASENAME),
|
||||
|
||||
F_NAME_MASK = (F_FILENAME | F_BASENAME),
|
||||
};
|
||||
|
||||
struct __attribute__((__packed__)) indexed_content {
|
||||
|
@ -119,8 +119,10 @@ the file where warnings or errors are detected by coloring the bar
|
||||
yellow or red, respectively. Tick marks will also be added to the
|
||||
left and right hand side of the bar, for search hits and bookmarks.
|
||||
|
||||
When multiple files are open, a bar on the left side is color coded and
|
||||
broken up to indicate which messages are from the same file.
|
||||
A bar on the left side is color coded and broken up to indicate which
|
||||
messages are from the same file. Pressing the left-arrow or 'h' will
|
||||
reveal the source file names for each message and pressing again will
|
||||
show the full paths.
|
||||
|
||||
When at the bottom of the log view, a summary line will be displayed on the
|
||||
right-hand-side to give you some more information about your logs, including:
|
||||
@ -190,7 +192,9 @@ Spatial Navigation
|
||||
b/bs/pgup Move up a page.
|
||||
j/cr/down-arrow Move down a line.
|
||||
k/up-arrow Move up a line.
|
||||
h/left-arrow Move to the left.
|
||||
h/left-arrow Move to the left. In the log view, moving left will reveal
|
||||
the source log file names for each line. Pressing again
|
||||
will reveal the full path.
|
||||
l/right-arrow Move to the right.
|
||||
H/Shift+left Move to the left by a smaller increment.
|
||||
L/Shift+right Move to the right by a smaller increment.
|
||||
@ -295,9 +299,6 @@ Display options
|
||||
means it has sped up. You can use the "s/S" hotkeys to
|
||||
scan through the slow downs.
|
||||
|
||||
. In the log view, toggle the display of filenames showing
|
||||
where each log line comes from.
|
||||
|
||||
i View/leave a histogram of the log messages over
|
||||
time. The histogram counts the number of
|
||||
displayed log lines for each bucket of time. The
|
||||
|
Loading…
Reference in New Issue
Block a user