brackets-archive / bracketsIssues

Archive of issues in brackets.
0 stars 0 forks source link

[CLOSED] Addresses issue #10846 #9539

Open core-ai-bot opened 3 years ago

core-ai-bot commented 3 years ago

Issue by thehogfather Wednesday Apr 08, 2015 at 12:13 GMT Originally opened as https://github.com/adobe/brackets/pull/10850


@abose@peterflynn (apologies it isn't solely related to #10846 - it felt sensible to combine into one PR) Fold states are now persisted using viewState (state.json) Added copyright text into foldcode.js and foldgutter.js Removed strings.js file Removed latex-fold helper Removed menu item for custom region folding Disable custom region folding by default


thehogfather included the following code: https://github.com/adobe/brackets/pull/10850/commits

core-ai-bot commented 3 years ago

Comment by abose Wednesday Apr 08, 2015 at 12:40 GMT


Code folding is enabled in all files by default, and in some files like txt files it looks a bit odd. Would it be a good thing to enable code folding in only HTML,XML,js Etc. and disabled in all other file types?

core-ai-bot commented 3 years ago

Comment by thehogfather Wednesday Apr 08, 2015 at 18:18 GMT


@abose I suspect the fold marks are appearing in a txt file due to indentations. A suggestion would be to disable the alwaysUseIndentFold option so that only files with registered mode helpers for code-folding have fold markers?

core-ai-bot commented 3 years ago

Comment by peterflynn Thursday Apr 09, 2015 at 07:50 GMT


@thehogfather This looks great overall, thanks for posting this update so quickly! I added a few comments above.

One other note: this fixes bug #10848 for the "enabled" preference, but the other preferences still seem to need a restart or close/reopen file to take effect. Did you want to wait for another PR to fix those other prefs?

core-ai-bot commented 3 years ago

Comment by peterflynn Thursday Apr 09, 2015 at 08:28 GMT


@thehogfather Fyi, I've opened PR #10859 with some UI changes as well as a few code tweaks. Some of it duplicates change you've made here (I started working on it before you posted this), so once your PR is merged I'll rebase mine on top of your changes. But please take a look and see if there's anything else there you'd be concerned about.

core-ai-bot commented 3 years ago

Comment by abose Thursday Apr 09, 2015 at 12:48 GMT


@thehogfather Now that custom region fold support is removed, fold helper - region-fold.js could also be removed.

core-ai-bot commented 3 years ago

Comment by thehogfather Thursday Apr 09, 2015 at 16:38 GMT


@abose@peterflynn I think this should be closer to ready than before. Cleaned up the strings and removed custom-region folding completely. Now over to you. Happy to help with anything else you direct my way.

core-ai-bot commented 3 years ago

Comment by peterflynn Thursday Apr 09, 2015 at 22:23 GMT


Looks like minFoldSize and alwaysUseIndentFold still require close & reopen to take effect. Do you want to spin that off as a separate bug?

core-ai-bot commented 3 years ago

Comment by peterflynn Thursday Apr 09, 2015 at 22:30 GMT


Hmm, it also looks like folds are no longer remembered when you close & reopen a file, even with a completely clean slate of prefs. Seems like something is broken with the view-state storage changes here...

core-ai-bot commented 3 years ago

Comment by thehogfather Thursday Apr 09, 2015 at 22:45 GMT


WRT minFoldSize and alwaysUseIndentFold lets file a separate bug with steps to reproduce. When I test it I get the effects immediately within the brackets.json file being edited (after saving).

core-ai-bot commented 3 years ago

Comment by peterflynn Friday Apr 10, 2015 at 01:03 GMT


Btw, it's still a ways off but it will be interesting to think about what having the same document visible in two split panes will mean for code folding. Should collapsing a section in one pane automatically collapse it in the other? Seems like that would feel weird, but otoh if each editor has its own expand/collapse state for the same document, how will that be persisted? Which one "wins" if you close both views? Etc.

I'll add a note to that Trello story so we can think about it more when the time comes.

core-ai-bot commented 3 years ago

Comment by abose Friday Apr 10, 2015 at 10:26 GMT


Loos good now; Merging this PR. @peterflynn brackets/pull/10859 can now be merged.

core-ai-bot commented 3 years ago

Comment by MarcelGerber Friday Apr 10, 2015 at 13:15 GMT


@peterflynn It's the same issue for selections/cursors, having two states in one document is weird anyway.

core-ai-bot commented 3 years ago

Comment by peterflynn Friday Apr 10, 2015 at 18:22 GMT


@abose Wait, why did you merge this already? See my comments above -- https://github.com/adobe/brackets/pull/10850#issuecomment-91371932 and https://github.com/adobe/brackets/pull/10850#discussion_r28110161 -- code folding persistence is completely broken in master now because of this PR. We should have waited before fixing that blocker before merging...

I'll file a high-priority bug to track it.