Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix change detection when adding files to a sketch #4849
Change Detector now differentiates between a merge conflict (same file changed; will load the external changes if accepted by user; discards editor content) or a non-conflicting change (will load the external changes if accepted by user; nothing is lost). This is done per file so that if one tab does conflict and the next doesn't, the non-conflicting tab is not discarded for no reason.
@GKFX I like your idea and it works as expected, I just think the dialogs are way too complicated and as a user I'm really confused. This makes my brain melt :)
@benfry How do you think this should work? It's more of a design problem.
Current approach is to either
Problem is when you have modified tabs and you change one file externally, you either have to scrap changes in all tabs and reload the sketch, or ignore the external changes.
The approach proposed in this PR is to detect tabs which were modified by external program (timestamp changed), and either
The idea is good because if you modify something externally, you probably want to reload just that and keep other tabs intact. The problem is that we have to save all other tabs in order to reload only one file, and it's really hard to explain what is going on.
I think to address the problem we should rather write code to reload separate tabs and show one dialog per tab (like other editors):
That sounds right with minor changes: