Skip to content

Fixed window jumping - #8

Open
Wintaru wants to merge 2 commits into
bubenkoff:masterfrom
Wintaru:master
Open

Fixed window jumping#8
Wintaru wants to merge 2 commits into
bubenkoff:masterfrom
Wintaru:master

Conversation

@Wintaru

@Wintaru Wintaru commented Apr 19, 2018

Copy link
Copy Markdown

I know this is considered a bug in SublimeText, but the fix seemed
simple enough. Thanks to fico for the code, which I found here:

https://forum.sublimetext.com/t/change-language-lost-focus-annoying-behavior/18986/3


This change is Reviewable

Josh Donner added 2 commits April 19, 2018 07:44
I know this is considered a bug in SublimeText, but the fix seemed
simple enough. Thanks to fico for the code, which I found here:

https://forum.sublimetext.com/t/change-language-lost-focus-annoying-behavior/18986/3
If you have the same file open in multiple groups, the previous fix
wasn't enough, I think this is more robust now.
@Wintaru

Wintaru commented Apr 19, 2018

Copy link
Copy Markdown
Author

To further clarify, the changes in 74502bc fixed an issue where focus would be changed to the wrong view open and also sometimes caused position changes in the wrong view.

@chrisgross

Copy link
Copy Markdown

If this works, I would love for this to be merged. The jumping is really annoying.

Comment thread ExpandTabsOnSave.py
group = window.active_group()
x, y = a_view.viewport_position()

print('group: {0}'.format(str(group)))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Comment thread ExpandTabsOnSave.py
a_view.run_command('unexpand_tabs')

# Restore the viewport position and selections.
window.focus_group(group)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use extract the logic with restoring the position and selections into a context manager

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

Successfully merging this pull request may close these issues.

3 participants