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

[Bug]: There is a bug in the ”discard“ feature. #734

Open
fantab01 opened this issue Jun 9, 2024 · 3 comments
Open

[Bug]: There is a bug in the ”discard“ feature. #734

fantab01 opened this issue Jun 9, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@fantab01
Copy link

fantab01 commented Jun 9, 2024

Describe the bug

Describe

When a complex md file uses the discard function, it will show that the file has been changed when switching to reading mode, but when clicking the diff view, it will show that there is no difference.(The gif is recorded in a sandbox environment. The only change to the sandbox environment is to install the git plugin.)

Relevant errors (if available) from notifications or console (CTRL+SHIFT+I)

SYSTEM INFO:
	Obsidian version: v1.6.3
	Installer version: v1.5.12
	Operating system: Windows 10 Pro 10.0.19045
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 1
	Plugins enabled: 1
		1: Git v2.24.2

RECOMMENDATIONS:
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Steps to reproduce

Special notes for reproducing bugs.md
bug

Expected Behavior

Switching to reading mode shouldn't change the file, right? I'm curious about the cause of this bug.

Addition context

No response

Operating system

Windows

Installation Method

None

Plugin version

v2.24.2

@fantab01 fantab01 added the bug Something isn't working label Jun 9, 2024
@Vinzent03
Copy link
Owner

Please execute the git diff <path to your file> command in the terminal to see the actual diff. But I agree that switching to reading more shouldn't change the file itself.

@fantab01
Copy link
Author

fantab01 commented Jun 16, 2024

Please execute the git diff <path to your file> command in the terminal to see the actual diff. But I agree that switching to reading more shouldn't change the file itself.

Thank you for your advice, it’s very useful. This is another classic line ending issue. I have temporarily solved it by using git config core.autocrlf true. However, I am curious as to why switching to reading mode triggers the plugin's diff changes, and how you plan to resolve it. This situation can indeed cause confusion.
image

@Vinzent03
Copy link
Owner

This plugin doesn't touch your file when switching to reading mode, that has to be Obsidian. I think the plugin is working mostly correctly. The only issue is that the diff view doesn't show that the line endings have changed, but from what I know that's typical for diff views.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants