Skip to content

File change detection feature #3620

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

Closed
wants to merge 3 commits into from

Conversation

pvrs12
Copy link

@pvrs12 pvrs12 commented Aug 4, 2015

Hi, I implemented a feature in the Processing project to detect if a file in the sketch was changed externally (since the "Use External Editor" option was removed) and decided to see if I could implement it for the Arduino editor as well.

This PR should implement the Change Detector as it is in Processing with a few tweaks to support the differences in the Arduino editor.

The changes made to Sketch, Sketchcode, SketchData, and Editor are required to support the Change Detector.

@Chris--A
Copy link
Contributor

Chris--A commented Aug 4, 2015

Shouldn't the watcher be enabled automatically when external editing is enabled, rather than a toggle for each function.

Although I guess this is similar to Notepad++ behavior when you return focus to the window after changing files externally.

@pvrs12
Copy link
Author

pvrs12 commented Aug 4, 2015

@Chris--A Yes, the way it works right now is if external editing is enabled the editor blocks input and reloads the sketch whenever compiled.

This watcher was originally written for Processing which removed the external editor option a while ago. Since I'd already written the code for that I figured I'd port it over for Arduino's editor too.

I think ideally this should be able to replace the existing external editor option (but that isn't my call) to have something more standardized (just like N++)

@Chris--A
Copy link
Contributor

Chris--A commented Aug 4, 2015

Ah, I see: A replacement, rather than addition. It would be better like that I think.

Some way of letting the user know it has been reloaded (or optionally ask) would be good. I like the fact that when I change git branches, notepad++ will ask if I want to reload the file as it was changed externally.

@ffissore ffissore self-assigned this Aug 4, 2015
@ffissore
Copy link
Contributor

ffissore commented Aug 4, 2015

As @Chris--A notices, a "file has changed" notification should be implemented as well. Such notification is a change of an existing working behaviour. We are not going to remove "use external editor". @pvrs12 thank you for your effort but I'm not going to merge this: we are happy enough with the current implementation

@ffissore ffissore closed this Aug 4, 2015
@ffissore ffissore added the Component: IDE user interface The Arduino IDE's user interface label Aug 4, 2015
@ffissore ffissore added this to the Release 1.6.6 milestone Aug 4, 2015
@pvrs12
Copy link
Author

pvrs12 commented Aug 4, 2015

Thanks for considering it, I totally understand your decision. It should also be noted there is a notification in this implementation at ChangeDetector:147

If it is decided that you want this in the future (and it can't be merged) let me know and I'll tweak it if necessary :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE user interface The Arduino IDE's user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants