Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

n/N to move between search results and not clusters #1193

Open
bagonyi opened this issue Oct 5, 2023 · 4 comments
Open

n/N to move between search results and not clusters #1193

bagonyi opened this issue Oct 5, 2023 · 4 comments
Labels
enhancement Feature Request

Comments

@bagonyi
Copy link

bagonyi commented Oct 5, 2023

I would like to re-request a feature I created a ticket for several years ago (#394).

Please make the n/N keys configurable in lnav, so that when pressing the keys to navigate between the next/previous search result it always take me to the next search hit, and not to the next cluster.

In the recording below, every time I press n it takes me to the next search cluster, instead of the next search hit.

lnav-cluster-search

I understand the use-case for skipping results close to each other; if one wants to quickly scan through a file where they are not interested in the results line-by-line, only cluster-by-cluster, not having to press n thousands of times to go through the entire log file is a big convenience.

However, my use case for analysing log files is different. I heavily rely on being able move between the search results line by line, as every single line contains information I need to look at. Currently, the only workaround I have, is to continuously monitor the hit counter, and whenever I press n the hit counter increases by more than 1, I have to press N to go back to the cluster and use the arrow keys to navigate through the cluster line-by-line.

Please consider making the cluster search functionality toggleable.

@bagonyi bagonyi added the enhancement Feature Request label Oct 5, 2023
@tstack
Copy link
Owner

tstack commented Oct 5, 2023

Try turning on cursor-mode by pressing CTRL + X. You can permanently enable cursor mode by running the following :config command:

:config /ui/movement/mode cursor

@bagonyi
Copy link
Author

bagonyi commented Oct 6, 2023

Thank you for pointing out cursor-mode, it is indeed a good workaround.

The only issue I have noticed, is that when moving between the error messages in cursor-mode using the e key, the line under focus will cause the text to be hidden, due to the background and foreground colours being the same.

Cursor not on the error line:

Screenshot 2023-10-06 at 10 54 51

Cursor on the error line:

Screenshot 2023-10-06 at 10 55 08

@bagonyi
Copy link
Author

bagonyi commented Oct 6, 2023

Another issue I am seeing is that in cursor mode the chronological navigation using the r/R keys appears to be somewhat broken.

If in cursor mode I go to the first line in the log file, type :goto 1 seconds later, and press the r key a few times, the cursor advances second by second, as expected. When I press the R key, the cursor goes back to a second earlier. However, when I press the R key a 2nd time, nothing happens, it just stays on the same line. If I exit cursor mode, the R key starts to function as expected.

@tstack
Copy link
Owner

tstack commented Oct 6, 2023

The only issue I have noticed, is that when moving between the error messages in cursor-mode using the e key, the line under focus will cause the text to be hidden, due to the background and foreground colours being the same.

Ah, sorry, this is a bug in the default theme. Maybe try a different one for now, I usually use the monocai theme. You can change the theme with the :config command. For example, to set it to monocai, you would do:

:config /ui/theme monocai

If in cursor mode I go to the first line in the log file, type :goto 1 seconds later, and press the r key a few times, the cursor advances second by second, as expected. When I press the R key, the cursor goes back to a second earlier. However, when I press the R key a 2nd time, nothing happens, it just stays on the same line. If I exit cursor mode, the R key starts to function as expected.

I can replicate this, thanks! I'll get it fixed right away.

tstack added a commit that referenced this issue Oct 6, 2023
set_top() was called instead of set_selection()

Mentioned in #1193
ppsx pushed a commit to Inflight-Audio-Ltd/lnav that referenced this issue Feb 29, 2024
set_top() was called instead of set_selection()

Mentioned in tstack#1193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants