Skip to content

Commit 1060a84

Browse files
committed
Add a docstring
1 parent 700dd77 commit 1060a84

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/textual/widgets/_select.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ def select(self, index: int | None) -> None:
113113
self.scroll_to_highlight()
114114

115115
def _find_search_match(self, query: str) -> int | None:
116+
"""A simple substring search which favors options containing the substring
117+
earlier in the prompt.
118+
119+
Args:
120+
query: The substring to search for.
121+
122+
Returns:
123+
The index of the option that matches the query, or `None` if no match is found.
124+
"""
116125
best_match: int | None = None
117126
minimum_index: int | None = None
118127

0 commit comments

Comments
 (0)