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

Redraw window after copy/move #1516

Closed
snprajwal opened this issue Dec 1, 2023 · 6 comments
Closed

Redraw window after copy/move #1516

snprajwal opened this issue Dec 1, 2023 · 6 comments

Comments

@snprajwal
Copy link

Copying/moving files from one location to another does not trigger a redraw. The new file is not visible, and requires closing and opening lf to see it in the destination. I'm strongly suspecting that the issue here is identical to #792, but for these operations instead of delete. For reference, I'm using r31 on Arch Linux 6.6.3-arch1-1.

@joelim-work
Copy link
Collaborator

I can't reproduce this issue. Can you reproduce this on a default setup with no config file? Also does running the load command manually cause the new files to show up?

I find it strange that this is an issue, given that copying/moving files is a core feature in lf.

@snprajwal
Copy link
Author

I just checked, I can confirm that this issue is reproducible on a default setup with no config file, but only with external USB drives. The drive is mounted at /run/media/<username>/<drive_label>. I can also confirm that manually running load does not cause the new files to show up. What's more, deleting existing files does not remove them from the view either, until I close and open lf again.

@joelim-work
Copy link
Collaborator

I think the updates only show up if the mtime of the directory changes - that is to say lf will store the mtime of the directory when it is loaded, and check if to see if it has changed after copying/moving/deleting files, and only then refresh the view. I guess the issue is because of the filesystem on the USB drive itself?

Also if you try running the reload command that should do a hard refresh, hopefully that will serve as a workaround until you figure out the issue.

@snprajwal
Copy link
Author

snprajwal commented Dec 4, 2023

I guess the issue is because of the filesystem on the USB drive itself?

That could be possible, the drive contains a regular FAT32 partition. I still think that the window should be redrawn explicitly after an operation that modifies the files in view, i.e. move/copy/delete. It should typically not require a conditional check since it is known that the files in view would have changed (even in the case of moving a file from and to the same directory, either an error is generated or a duplicate file is created. Both ways, the view will be changed). I'll dig into the source and see if I can find where this is coming from. Thanks for the workaround, I'll try it the next time I plug the drive in.

@joelim-work
Copy link
Collaborator

If you're interested in digging through the source code, you can follow the nav.paste function:

lf/nav.go

Line 1471 in 6abce04

func (nav *nav) paste(app *app) error {

This should eventually internally trigger a load command, which checks whether the directory mtime is changed or not:

lf/nav.go

Line 508 in 6abce04

func (nav *nav) checkDir(dir *dir) {

Enabling logging using the -log option may also help you here.

@joelim-work
Copy link
Collaborator

Closing in favor of the discussion taking place in #1659

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

No branches or pull requests

2 participants