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

fix: not being able to delete a buffer when it is modified #399

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

mikavilpas
Copy link
Owner

Problem:

When a file is trashed (moved to the trash) or deleted (hard deleted) in yazi, the buffer associated with the file is deleted. However, if the buffer is modified, the buffer cannot be deleted. This is because the buffer has unsaved changes.

Solution:

Force delete the buffer when it is being deleted, losing any unsaved changes.

Originally I wanted to make sure no unsaved changes are lost, but I noticed neo-tree does not care about unsaved changes when deleting a file, so I decided to follow the same behavior.

Solves #397

Problem:

When a file is trashed (moved to the trash) or deleted (hard deleted) in
yazi, the buffer associated with the file is deleted. However, if the
buffer is modified, the buffer cannot be deleted. This is because the
buffer has unsaved changes.

Solution:

Force delete the buffer when it is being deleted, losing any unsaved
changes.

Originally I wanted to make sure no unsaved changes are lost, but I
noticed neo-tree does not care about unsaved changes when deleting a
file, so I decided to follow the same behavior.

Solves #397
@mikavilpas mikavilpas enabled auto-merge (squash) August 21, 2024 04:43
@mikavilpas mikavilpas merged commit 8b0ecd8 into main Aug 21, 2024
14 checks passed
@mikavilpas mikavilpas deleted the fix-delete-error branch August 21, 2024 04:44
This was referenced Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant