-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
Sometimes navigation scrolls to the right #1139
Conversation
core/commands/navigate.py
Outdated
# The following shouldn't strictly be necessary, but Sublime sometimes | ||
# jumps to the right when show_at_center for a column-zero-point occurs. | ||
_, vp_y = view.viewport_position() | ||
view.set_viewport_position((0, vp_y), False) |
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.
view
is undefined. (Maybe we should start using flake8?)
core/commands/navigate.py
Outdated
@@ -32,6 +32,11 @@ def run(self, edit, forward=True): | |||
sel.add(sublime.Region(new_position, new_position)) | |||
self.view.run_command("show_at_center") |
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.
The modern version of this is self.view.show_at_center(new_position)
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.
Following a rule for legacy code: Whenever you open a file to edit, leave it in a better state.
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.
Thats true, thanks
That's probably a good idea! The commit message is wrong, it should be more like "Pin viewport's x-axis to 0 after |
Sometimes navigation scrolls to the right, allways scroll back to left.
0dd090e
to
bffa311
Compare
👍 |
The same 'shift-to-right' can happen if we replace the buffers content, so maybe we should add that to our replace-content command as well. |
I have never experienced that, but if you say so. Would you make that PR. I am for adding flake8. We have used pycodestyle for a while. As I quickly rescearch I fould that we can run both and that should confilict. |
A small correction. We did have flake8 setup in setup.cfg but we should run it on CI and I should setup the linter in sublime. |
The whole project has a dozens flake8 errors right now that's why I never turned them on on CI 😁 |
No description provided.