Skip to content

Commit

Permalink
Merge pull request #3424 from davep/command-palette-lazy-show
Browse files Browse the repository at this point in the history
  • Loading branch information
davep authored Oct 2, 2023
2 parents 4684632 + 8c8928d commit efd00de
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/textual/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ def _show_no_matches() -> None:
id=self._NO_MATCHES,
)
)
self._list_visible = True

self._no_matches_timer = self.set_timer(
self._NO_MATCHES_COUNTDOWN,
Expand Down Expand Up @@ -765,6 +766,7 @@ def _refresh_command_list(
command_list.clear_options().add_options(sorted(commands, reverse=True))
if highlighted is not None:
command_list.highlighted = command_list.get_option_index(highlighted.id)
self._list_visible = bool(command_list.option_count)

_RESULT_BATCH_TIME: Final[float] = 0.25
"""How long to wait before adding commands to the command list."""
Expand Down Expand Up @@ -813,10 +815,7 @@ async def _gather_commands(self, search_value: str) -> None:
# grab a reference to that.
worker = get_current_worker()

# We're ready to show results, ensure the list is visible.
self._list_visible = True

# Go into a busy mode.
# Reset busy mode.
self._show_busy = False

# A flag to keep track of if the current content of the command hit
Expand Down

0 comments on commit efd00de

Please sign in to comment.