Skip to content
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

fix log panel not scrolling on initial open #2188

Merged
merged 1 commit into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,4 @@ def on_post_window_command(self, window: sublime.Window, command_name: str, args
if panel_manager.is_panel_open(PanelName.Diagnostics):
sublime.set_timeout_async(wm.update_diagnostics_panel_async)
elif panel_manager.is_panel_open(PanelName.Log):
sublime.set_timeout(panel_manager.update_log_panel)
sublime.set_timeout(lambda: panel_manager.update_log_panel(scroll_to_selection=True))
4 changes: 3 additions & 1 deletion plugin/core/panels.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ def toggle_output_panel(self, panel_type: str) -> None:
def is_panel_open(self, panel_name: str) -> bool:
return self._window.is_valid() and self._window.active_panel() == "output.{}".format(panel_name)

def update_log_panel(self) -> None:
def update_log_panel(self, scroll_to_selection: bool = False) -> None:
panel = self.ensure_log_panel()
if panel and self.is_panel_open(PanelName.Log):
panel.run_command("lsp_update_log_panel")
if scroll_to_selection:
panel.show(panel.sel(), animate=False)

def ensure_panel(self, name: str, result_file_regex: str, result_line_regex: str,
syntax: str, context_menu: Optional[str] = None) -> Optional[sublime.View]:
Expand Down
3 changes: 2 additions & 1 deletion stubs/sublime.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,8 @@ class View:
def visible_region(self) -> Region:
...

def show(self, x: Union[Selection, Region, int], show_surrounds: bool = ...) -> None:
def show(self, x: Union[Selection, Region, int], show_surrounds: bool = True, keep_to_left: bool = False,
animate: bool = True) -> None:
...

def show_at_center(self, x: Union[Selection, Region, int], animate: bool = True) -> None:
Expand Down