jtilander / niftyplugins

Visual Studio productivity plugins
MIT License
40 stars 24 forks source link

Implement "revert if unchanged" #106

Closed belkiss closed 8 years ago

belkiss commented 8 years ago

Hello,

I've added a small feature that I use a lot, the "Revert unchanged". I mimic the P4VS behavior, which is to do the revert unchanged without confirmation, as it won't cause any data loss.

I hope it will be helpful to others, thanks! Lambert

PS: Thanks for the VS2015 version :)

jtilander commented 8 years ago

Hi Lambert,

Cool, thanks for the change. A question though -- I think when I did the original revert I didn't bother with checking the status of the document itself, but now if one does "revert unchanged" and you have some modified changes in your document that you have not saved, don't we either have to flush the changes (save) or check for pending changes in the doc?

Cheers, Jim

belkiss commented 8 years ago

Hey Jim,

It seems that VS doesn't consider the file becoming read-only again a change requiring a reload, so it doesn't display the "do you want to reload" popup. So if you have pending changes to the file, doing a "revert unchanged" won't cause you to loose them, the file will remain modified, and you can then checkout the file again if you want to save them.

In my opinion this behavior is acceptable, what do you think?

Thanks, Lambert

jtilander commented 8 years ago

That sounds fine. I'll merge it and give it a spin.

belkiss commented 8 years ago

Cool, thanks!

Lambert