-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Saving the tabs settings per file/project #3039
Conversation
@TomMalbran I haven't done an in-depth code review of this yet, but I have a couple high-level concerns first:
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? |
|
||
// Error message | ||
if (errorMessage) { | ||
$dlg.find(".settings-list").append("<div class='alert-message' style='margin-bottom: 0'>" + errorMessage + "</div>"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for cleaning this error message stuff up btw -- much nicer the way you've done it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I could commit this changes as a separate request if this one isn't merged.
@peterflynn Thanks for the review, this are some of my thoughts/ideas:
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? |
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. |
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. |
@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. |
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.