Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

cmd+ and cmd- should keep you at the same line in the file #4084

Closed
colllin opened this issue Nov 7, 2014 · 6 comments · Fixed by #12696
Closed

cmd+ and cmd- should keep you at the same line in the file #4084

colllin opened this issue Nov 7, 2014 · 6 comments · Fixed by #12696
Assignees
Labels

Comments

@colllin
Copy link
Contributor

colllin commented Nov 7, 2014

No description provided.

@ksrivastava
Copy link

I can't repro - is this a problem with all file types? Which version of Atom and what OS are you using?

@colllin
Copy link
Contributor Author

colllin commented Nov 8, 2014

osx-yosemite/atom-v0.143.0

Maybe try it in a longer file? Put your cursor at line 100+. It seems to scale the text with the scaling origin at the top of the file. If I place my cursor in line 500, a single press of cmd + moves the cursor out of sight.

@mnquintana
Copy link
Contributor

Still an issue on Atom 0.196.0 and OS X 10.10.3

@phord
Copy link
Contributor

phord commented Jan 5, 2017

The proposed fix from @mnquintana doesn't quite do the right thing. It tries to keep the cursor on the display, but the cursor is not necessarily on the viewport in the first place. So this adds a new oddity to the problem.

I do have a fix that almost works when auto-wrap is disabled, but it gets the viewport wrong when wrap is enabled. I haven't figured out how to properly position the screen when wrap is on. Or maybe there's a bug in pixelPositionForBufferPosition. I'm not sure what it's expected to do. My attempt is here: 9684966

But my fix only works for the active buffer. Other buffers which are not currently visible do not get updated correctly. There's some discussion of that in #6673, hinting at a more extensive architectural fix that's required to address it.

@phord
Copy link
Contributor

phord commented Jun 2, 2017

Confirmed this is fixed in 1.19.0.

Edited to add: Except it still has a problem with the soft-wrap option. Maybe it's still a bug in pixelPositionForBufferPosition. Soft-wrap awakens other unexpected behaviors, though, so I suppose that does not belong to this issue.

@lock
Copy link

lock bot commented Apr 1, 2018

This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

@lock lock bot locked and limited conversation to collaborators Apr 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants