Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve positioning when opening file at line #19272
Issue or RFC Endorsed by Atom's Maintainers
Description of the Change
Prior to this change, when you opened a file at a specific line, Atom would scroll to the given line number, but only enough so that the line is visible at the bottom of the editor. #12253 describes the problem with this behavior as follows:
With the changes in this pull request, when opening a file at a specific line, Atom will:
In response to the problem that "plugins like JSHint that are displayed at the bottom will cover the desired line number," #12253 suggests scrolling the requested line to the top of the editor.
We could scroll the line to the top of the editor. However, centering the line vertically also resolves the stated problem. In addition to that, it has a couple advantages over scrolling the line to the top of the editor:
None that I'm aware of.
The following steps use a file named
Before and After
rafeca left a comment
Looks good to me!
I agree about centering the line on the editor (in fact the fuzzy finder does not center it when specifying a line number and I found this annoying, I'm gonna send a PR there to fix it