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

Rewrap marks files as modified in VS Code even if it didn't change anything #308

Closed
lostfictions opened this issue Jan 31, 2022 · 3 comments

Comments

@lostfictions
Copy link

lostfictions commented Jan 31, 2022

Hi again, thanks for this extension -- it's really useful and I use it all the time. One small nit I've encountered is: sometimes I'll hit the Rewrap shortcut just to check that something's been wrapped to the right length, but this always causes it to mark a file as "dirty" (changed and in need of saving) even if the action didn't change the text at all.

It's slightly confusing since I'll often absentmindedly hit the keybinding, read over some files before committing, and then get interrupted by VS Code warning me that there's unsaved changes. Then I have to stop and remember that no, I didn't actually modify anything further, Code is just a little muddled by an extension.

Not sure if the extension API offers an easy built-in way of handling this, but maybe it wouldn't be too hard to compare the block to be wrapped before and after wrapping and only apply the modification to the document if they're different?

@stkb
Copy link
Owner

stkb commented Jan 31, 2022

but maybe it wouldn't be too hard to compare the block to be wrapped before and after wrapping and only apply the modification to the document if they're different?

Yeah it used to do exactly this, but it got removed that when I was rewriting some stuff, with the plan of making it a bit smarter. Since it was minor I hadn't gotten around to writing its replacement yet. I'll put a fix in the next pre-release version.

@stkb stkb added the backlog On the backlog of things to do label Jan 31, 2022
stkb added a commit that referenced this issue Feb 6, 2022
Also fixes some of the arithmetic, which was wrong. And converts Edit
into a class so it can have the .empty and .isEmpty members. The
Fable.Core.AttachMembers attribute is then needed so the property names
are not mangled in JS.
@stkb
Copy link
Owner

stkb commented Feb 6, 2022

This should now be fixed in pre-release version 17.5

@stkb stkb added in pre-release version Is in pre-release version but not in stable yet and removed backlog On the backlog of things to do labels Feb 6, 2022
stkb added a commit that referenced this issue Feb 14, 2022
Also fixes some of the arithmetic, which was wrong. And converts Edit
into a class so it can have the .empty and .isEmpty members. The
Fable.Core.AttachMembers attribute is then needed so the property names
are not mangled in JS.
stkb added a commit that referenced this issue Feb 14, 2022
- Support .rmd files as markdown (#245)
- Basic support for Textile files as markdown (#271)
- Support FIDL (#255), Pascal/Delphi (#97) & pylintrc files (#121)
- Shell script: Ignore shebangs (#129)
- Add '//'-comments to CSS (workaround for #309)
- Fix batch files: case-insensitive "REM" and "@" prefix (#313)
- Fix the document being 'modified' if there were no actual changes
  (#308, #315)
@stkb
Copy link
Owner

stkb commented Feb 14, 2022

Now in stable v1.16.2.

@stkb stkb closed this as completed Feb 14, 2022
@stkb stkb removed the in pre-release version Is in pre-release version but not in stable yet label Feb 14, 2022
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

No branches or pull requests

2 participants