-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Finish the package: Fix Project Switch-Restart Bug #26
Comments
Issues: Finish the package: Fix Project Switch-Restart Bug #26 Restore session, does not set the last scroll position after a project change, or sublime restart #1379 sublimehq/sublime_text#1379 Scroll sync doesn't work (ST3 3084) https://github.com/titoBouzout/BufferScroll/issues/23 To accomplish it, it move the caret up and down, this way it forces the scroll view to be switched. This causes the undesired behavior when switching views after the file being loaded or the project being restored. To fix this problems, just on to perform those operations when the file is loaded for the first time. This is a problem when Sublime Text just starts because this package is not loaded yet. This way we need to perform this action at the first time the file is chose/switched to.
#26 First part implementation. Now remains to replace: ``` view.run_command( "move", {"by": "lines", "forward": False} ) view.run_command( "move", {"by": "lines", "forward": True} ) ``` By a actual command to change the view to the current cursor centered position.
Finished the first part implementation. Now remains to replace:
By a actual command to change the view to the current cursor Seconds step is to catch the change project command, and make the import sublime
import sublime_plugin
class SampleListener(sublime_plugin.EventListener):
def on_window_command(self, window, command, args):
if command == "edit_settings":
print ("About to execute " + command)
def on_post_window_command(self, window, command, args):
if command == "edit_settings":
print ("Finished executing " + command) https://forum.sublimetext.com/t/how-to-hook-the-new-show-settings-event/23793/2 {
"caption": "Project",
"id": "project",
"mnemonic": "P",
"children":
[
{ "command": "prompt_open_project_or_workspace", "caption": "Open Project…" },
{ "command": "prompt_switch_project_or_workspace", "caption": "Switch Project…" },
{ "command": "prompt_select_workspace", "caption": "Quick Switch Project…", "mnemonic": "S" },
{
"caption": "Open Recent",
"children":
[
{ "command": "open_recent_project_or_workspace", "args": {"index": 0 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 1 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 2 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 3 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 4 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 5 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 6 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 7 } },
{ "caption": "-" },
{ "command": "clear_recent_projects_and_workspaces", "caption": "Clear Items" }
]
}, |
This temporary fix is a priori concluded. It only down side is when opening a new window, not all cloned view will not be properly set due the bug:
The commit shows this stated state functionality: |
Issues: Finish the package: Fix Project Switch-Restart Bug evandrocoan/ITE#26 Restore session, does not set the last scroll position after a project change, or sublime restart #1379 sublimehq/sublime_text#1379 Scroll sync doesn't work (ST3 3084) https://github.com/titoBouzout/BufferScroll/issues/23 To accomplish it, it move the caret up and down, this way it forces the scroll view to be switched. This causes the undesired behavior when switching views after the file being loaded or the project being restored. To fix this problems, just on to perform those operations when the file is loaded for the first time. This is a problem when Sublime Text just starts because this package is not loaded yet. This way we need to perform this action at the first time the file is chose/switched to.
evandrocoan/ITE#26 First part implementation. Now remains to replace: ``` view.run_command( "move", {"by": "lines", "forward": False} ) view.run_command( "move", {"by": "lines", "forward": True} ) ``` By a actual command to change the view to the current cursor centered position.
Issues: Finish the package: Fix Project Switch-Restart Bug evandrocoan/ITE#26 Restore session, does not set the last scroll position after a project change, or sublime restart #1379 sublimehq/sublime_text#1379 Scroll sync doesn't work (ST3 3084) https://github.com/titoBouzout/BufferScroll/issues/23 To accomplish it, it move the caret up and down, this way it forces the scroll view to be switched. This causes the undesired behavior when switching views after the file being loaded or the project being restored. To fix this problems, just on to perform those operations when the file is loaded for the first time. This is a problem when Sublime Text just starts because this package is not loaded yet. This way we need to perform this action at the first time the file is chose/switched to.
evandrocoan/ITE#26 First part implementation. Now remains to replace: ``` view.run_command( "move", {"by": "lines", "forward": False} ) view.run_command( "move", {"by": "lines", "forward": True} ) ``` By a actual command to change the view to the current cursor centered position.
Issues: Finish the package: Fix Project Switch-Restart Bug #26 Restore session, does not set the last scroll position after a project change, or sublime restart #1379 sublimehq/sublime_text#1379 Scroll sync doesn't work (ST3 3084) https://github.com/titoBouzout/BufferScroll/issues/23 To accomplish it, it move the caret up and down, this way it forces the scroll view to be switched. This causes the undesired behavior when switching views after the file being loaded or the project being restored. To fix this problems, just on to perform those operations when the file is loaded for the first time. This is a problem when Sublime Text just starts because this package is not loaded yet. This way we need to perform this action at the first time the file is chose/switched to.
#26 First part implementation. Now remains to replace: ``` view.run_command( "move", {"by": "lines", "forward": False} ) view.run_command( "move", {"by": "lines", "forward": True} ) ``` By a actual command to change the view to the current cursor centered position.
The fix package is already completed, then this can be closed. |
Finish the package: Fix Project Switch-Restart Bug
It partially fix the issues:
To accomplish it, it move the caret up and down, this way it forces the scroll view to be switched.
This causes the undesired behavior when switching views after the file being loaded or the
project being restored.
To fix this problems, just to perform those operations when the file is loaded for the first time.
This is a problem when Sublime Text just starts because this package is not loaded yet. This way
we need to perform this action at the first time the file is chose/switched to.
I am thinking about to use the forward
on_plugin_loaded
to perform afor all views
, this way I can still use only theforward
on_loadto fix the issue post
Sublime Text` start and keep the scroll issue when switching views.The text was updated successfully, but these errors were encountered: