Skip to content

Commit

Permalink
refactor: allow optional variables for update_status_bar_text()
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Cherng <[email protected]>
  • Loading branch information
TerminalFi authored and jfcherng committed Jun 22, 2024
1 parent 36d10e9 commit 8308bc0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugin/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def is_valid_for_view(self, view: sublime.View) -> bool:
session = self.weaksession()
return bool(session and session.session_view_for_view_async(view))

def update_status_bar_text(self) -> None:
def update_status_bar_text(self, extra_variables: dict[str, Any] | None = None) -> None:
if not (session := self.weaksession()):
return

Expand All @@ -277,6 +277,9 @@ def update_status_bar_text(self) -> None:
"server_version_gh": self.server_version_gh,
}

if extra_variables:
variables.update(extra_variables)

rendered_text = ""
if template_text := str(session.config.settings.get("status_text") or ""):
try:
Expand Down

0 comments on commit 8308bc0

Please sign in to comment.