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

dircounts is not refreshed with load command #776

Closed
srimadhan11 opened this issue Mar 8, 2022 · 5 comments · Fixed by #1638
Closed

dircounts is not refreshed with load command #776

srimadhan11 opened this issue Mar 8, 2022 · 5 comments · Fixed by #1638
Labels

Comments

@srimadhan11
Copy link

srimadhan11 commented Mar 8, 2022

Directory's dircounts is not changing, when the number of sub files/directories has been changed. Using the load command doesn't work, so setting period option to non-zero is also not working. However, I was able to use reload command to update the sub files/directories count.

I have disabled the dircache option (#627 #673). But disabling the dircache (along with set period 1) only updates the changes in the sub files/directories list, not the sub files/directories count. Because of which, the dircounts becomes inconsistent.

So, is this a bug? or maybe I am missing something?

@gokcehan
Copy link
Owner

@srimadhan11 What do you mean when you say the count becomes inconsistent? Can you provide a steps to reproduce here?

@srimadhan11 srimadhan11 changed the title dircount is not refreshed with load command dircounts is not refreshed with load command Mar 11, 2022
@srimadhan11
Copy link
Author

@gokcehan Sorry for not including the steps to reproduce the bug in my previous comment. I have explained them below.

Initial directory structure,

DirA/
    DirB
    DirC
    FileD

Steps:

  1. navigate to DirA in lf
  2. execute the shell command, touch DirA/FileE to create new file inside DirA
  3. dircounts for DirA will still remains to be 3, whereas its children's list gets updated and shows the new file FileE

I am using lf with version r26, and few relevant configs in my lfrc,

set dircounts
set dircache off
set period 1

@gokcehan gokcehan added bug and removed question labels Mar 12, 2022
@gokcehan
Copy link
Owner

@srimadhan11 I think you are right, this should update with load commands. I don't see any reason it shouldn't. Marking the issue as a bug.

Not quite related to this issue but set dircache off in your example should be set nodircache instead. More about this in #758 . But it still does not update dircounts and it seems that period and dircache does not work well together resulting in loading screens periodically.

@gokcehan
Copy link
Owner

@srimadhan11 I have taken a look at this today and unfortunately it does not seem as easy as I first imagined. The issue is that dircount is stored in the file itself in the parent's list. Since parent directory is not changed in this command, the directory is not refreshed and the dircount stays the same. So this behavior is somewhere in between a bug and working as intended. I would love to see an easy solution for this but I wouldn't get my expectations high if I were you. If you are using a custom command for creating a new file, maybe you can consider adding a manual remote reload at the end as a workaround.

@srimadhan11
Copy link
Author

Ohh okay, I thought it might be a small bug. Thank you for looking into this issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants