Skip to content

Commit a1dd8d4

Browse files
committed
tag_search: order shorter tag names first
1 parent 8ce773b commit a1dd8d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tagstudio/core/library/alchemy/library.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ def search_tags(self, name: str | None, limit: int = 100) -> tuple[list[Tag], li
10731073
name = name.lower()
10741074

10751075
def sort_key(text: str):
1076-
return (not text.startswith(name), text)
1076+
return (not text.startswith(name), len(text), text)
10771077

10781078
with Session(self.engine) as session:
10791079
query = select(Tag.id, Tag.name)

0 commit comments

Comments
 (0)