Skip to content
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] Set _fontSizePrefsLoaded to true before calling _adjustFontSize. #6481

Open
core-ai-bot opened this issue Aug 30, 2021 · 6 comments

Comments

@core-ai-bot
Copy link
Member

Issue by RaymondLim
Tuesday Mar 11, 2014 at 21:14 GMT
Originally opened as adobe/brackets#7165


This change fixes the issue #7093 since the flag has to be true in order to set the scroll position to the right location.

@TomMalbran Can you review this since you're the one who works on this area a lot?

Note that this specific issue is also introduced by recent CodeMirror update. If I use the CodeMirrror version from sprint-36, then I don't see the issue even if I'm running in the master b64a2a15b with the new view state settings implementation.


RaymondLim included the following code: https://github.com/adobe/brackets/pull/7165/commits

@core-ai-bot
Copy link
Member Author

Comment by TomMalbran
Tuesday Mar 11, 2014 at 21:36 GMT


The idea behind that flag is that the last time you save the scroll position it is saved using the new font size. When the font size is 15px, line 100 is roughly around 165px, but is at 115px when the font size is 10px. So I change the font size to 15px, and then scroll to line 100 and restart Brackets. The scroll was saved at 165px, so when I restore the scroll position, I know I need to use the saved scroll and not change it. If instead I readjusted the scroll, it would be way off.

I tried your changes without the zoom and the scroll is way off after restarting Brackets.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Tuesday Mar 11, 2014 at 22:36 GMT


This is much better for recipe #7093 . Using ProjectManager.js (2255 lines):

  • in master branch, shutting down and restarting Brackets re-opens file with line 1880 at bottom
  • in this branch, shutting down and restarting Brackets re-opens file with line 2246 at bottom

So, this seems to fix the second problem in this comment, but not the first problem.

@core-ai-bot
Copy link
Member Author

Comment by RaymondLim
Tuesday Mar 11, 2014 at 22:42 GMT


@redmunds The first problem in your comment has to do with Word Wrap and I've already logged an issue #7168 for that.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Tuesday Mar 11, 2014 at 23:00 GMT


@RaymondLim I have Word Wrap off, so I don't think that issue is related to what I am seeing.

@core-ai-bot
Copy link
Member Author

Comment by TomMalbran
Tuesday Mar 11, 2014 at 23:07 GMT


The real issue here is that on the initial load the scroll position is restored before restoring the font size. So if the scroll was at the end of a file before restarting, when restarting, on the original font-size, the saved scroll is higher than the length of the document, so it doesn't scroll to the saved one, and when later the font is increased, the scroll is in the wrong position.

The same is what happens with issue #7168. But there is another issue with wordwrap on, when you are just trying to increase the font size. Once a line lower than the visible one wraps into 2 lines, the restored scroll will be off by 1 line.

@core-ai-bot
Copy link
Member Author

Comment by RaymondLim
Wednesday Mar 12, 2014 at 16:53 GMT


Closing as this is not the correct fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant