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

dired-narrow moves the cursor unnecessarily in dired buffer #188

Open
geza-herman opened this issue Jan 18, 2022 · 0 comments
Open

dired-narrow moves the cursor unnecessarily in dired buffer #188

geza-herman opened this issue Jan 18, 2022 · 0 comments
Labels

Comments

@geza-herman
Copy link

geza-herman commented Jan 18, 2022

If adding a new character at the filter prompt creates a string, which matches both the current and the next line in the dired buffer, the cursor will move down in the dired buffer.

Repro: create an empty directory, and put files there named aaaaaaa1, aaaaaaa2, aaaaaaa3, aaaaaaa4.
Now, start dired in this directory, run dired-narrow, and type the string aaaaaaa at the Filter: prompt. Notice, that each press of a will move the cursor down in the dired buffer. If the cursor reaches the bottom, it will move upwards once, and then move downwards again. I expect that the cursor doesn't move if the currently selected dired entry still matches the filter.

I tried to fix this, and it seems to work if I add a condition at the bottom of dired-narrow--update (checks whether the cursor stands on an invisible line), but I'm not sure that this is a proper fix:

    (when (or (get-text-property (point) 'invisible) (not (dired-utils-is-file-p)))
      (unless (dired-hacks-next-file)
        (dired-hacks-previous-file))
      (unless (dired-utils-get-filename)
        (dired-hacks-previous-file)))
@Fuco1 Fuco1 added the bug label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

2 participants