gistpad icon indicating copy to clipboard operation
gistpad copied to clipboard

Saving a file that has no changes will create an unnecessary gist revision

Open Tedpac opened this issue 7 months ago • 1 comments

Describe the bug The title is self-explanatory.

To Reproduce Steps to reproduce the behavior:

  1. Open a gist file.
  2. Press “Ctrl + S”.
  3. Go to the gist revisions and check that there is a “No changes” revision.

Expected behavior If I save a file in which I have not made any changes, no revision will be created in the gist.

Desktop

  • VS Code Version: 1.99.3
  • GistPad Version: 0.8.2

Additional context Some people have a habit of pressing “Ctrl + S” all the time, which will probably result in a lot of “No changes” revisions in their gists.

Tedpac avatar Apr 20 '25 16:04 Tedpac

Yeah I'm one of those people that impulsively hit CTRL+S all the time, and I agree this needs to be fixed 😅

VS Code used to track when a file hasn't been changed since it was opened/saved, so that behavior appears to have changed. In https://gistpad.dev I track the original file state, and disable saving when there aren't actually changes. So I just need to introduce the same logic in the VS Code extension.

That said, I should be able to get to this in the next couple days. And apologies for the inconvenience.

lostintangent avatar Apr 20 '25 16:04 lostintangent

This has turned out to be trickier than I hoped, since I think VS Code is actually allowing saves to go through that don't have changes. I'll keep looking, but I wanted to let you know I'm still investigating this.

lostintangent avatar Jun 10 '25 17:06 lostintangent