Open core-ai-bot opened 3 years ago
Comment by peterflynn Tuesday Mar 12, 2013 at 01:20 GMT
@
TomMalbran I haven't done an in-depth code review of this yet, but I have a couple high-level concerns first:
@
GarthDB or NJ for their thoughts, or having a newsgroup thread...isWithinProject()
filtering in Editor.setProjectTabs() seems like it could confuse people. It also seems incorrect, given that freshly opened editors will respect the global setting regardless of whether they're within the project tree or not._instances
syncing even when the setting is changed just for one file.So, that's a whole bunch of stuff to tackle... and the infrastructure & UI level discussions could take some time. I wonder whether you could address many of the same pain points by starting with tab setting autodetection per file, without manual per-file overrides. That seems like an easier thing to land first since it doesn't raise as many "big" questions/changes. Thoughts?
Comment by TomMalbran Tuesday Mar 12, 2013 at 02:20 GMT
@
peterflynn Thanks for the review, this are some of my thoughts/ideas:
ProjectPreferences
file that had the dialog and all the preferences for the project. Then showProjectPreferencesDialog
could just grab all the preferences needed from the functions in this file. A better way would be to have the project settings for each file saved as a JSON object and use mustache to show the content of the file and then save it back getting the input values and the names as some sort of key.Editor.prototype._getTabPreference
. But I noticed that it is missing a isWithinProject
filter to default to the global ones for none project files.This seems all doable, except for point 1. I was doing this since I am working on another project besides Brackets that uses tabs instead of spaces, so I forget many times to change the settings and end up commiting with tabs instead of spaces. Both just having only project preferences and autodetecting per file could solve this. I added per file just to go with the Trello card and it should be useful too.
I didn't thought that auto-detection per file could solve my problem. So the idea would be a global preference that when enabled, it would check the tabs/spaces every time you switch editors and update the global preferences to what was found in the file?
Just having project preferences would be nice too, but I guess that would still have several of those open/big questions.
And, do you want me to address the merge issues anyway?
Comment by peterflynn Tuesday Mar 12, 2013 at 19:38 GMT
Oh, one other issue I just realized: afaict with this change as-is, there's no longer any way to set a global (not per-proj, not per-file) indentation preference. So if someone really dislikes our defaults, they'll have to manually reset them for every new project opened -- probably not ideal.
Comment by TomMalbran Tuesday Mar 12, 2013 at 22:37 GMT
Yes, I realized that, but I couldn't figure where to add this, since there isn't yet a preferences dialog for Brackets, and this aren't true/false preferences. My suggestion in point 3, could solve this, but without the dual mode.
So I am guessing that this pull is ahead of its time. Might be better to leave it until there is a better way to set the global, project and per file preferences.
Comment by TomMalbran Thursday Mar 28, 2013 at 22:01 GMT
@
peterflynn This requests looks like a no gone at this point in Brackets, since point 1 isn't fixable right now, and other need better planning or research. I am going to just close this, but let me know if there is something i can do to bring it back.
Issue by TomMalbran Tuesday Mar 05, 2013 at 03:19 GMT Originally opened as https://github.com/adobe/brackets/pull/3039
With this pull request changing the tabs type and tabs size will only change it for the current file. It also adds new tab settings for the entire project available at the project settings dialog. This will set all 3 tab settings for every open instance within the project, but only the ones that the file doesn't have saved, and will save them in the persistent storage so that the every new file opened will default to the project settings.
TomMalbran included the following code: https://github.com/adobe/brackets/pull/3039/commits