Repository navigation
Find a theme by the name omarchy theme list shows - #18795
Closed
ThePrimeagen wants to merge 3 commits into
Closed
ThePrimeagen wants to merge 3 commits into
ThePrimeagen wants to merge 3 commits into
Conversation
omarchy-theme-list shows each folder title-cased with its dashes as spaces, but omarchy-theme-set lowercased the name and turned its spaces into dashes before looking. A theme made by hand in a folder with capitals or spaces could not be applied, from the CLI or the theme picker, and a folder named Gruvbox applied the stock gruvbox instead. omarchy-theme-remove and omarchy-theme-dir did the opposite and took only the folder's own name, so the name the list shows for a dashed folder was not found, remove's own "Tokyo Night" example among them. Make omarchy-theme-dir the one lookup: a folder of exactly that name wins, otherwise the folder shown under it, compared in the C locale so a Turkish one does not lowercase I to a dotless i. Set, remove and the theme preview go through it, and theme.name keeps the folder's real name. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
[Medium impact] The PR appears safe to merge; the previous wrong-theme deletion issue is fixed. SummaryTheme commands now share a lookup that accepts folder names and the names shown by
Reviews (3) · Last reviewed commit: "Keep a trailing dash when matching the s..." · Reviewed by Greptile |
With user folders FOO and foo, omarchy theme list shows FOO and Foo, but omarchy-theme-dir lowercased Foo before comparing and took FOO, the first folder that matched. Setting Foo applied FOO, and removing Foo deleted it. Compare the name the list shows for each folder exactly first, and fall back to the case-folded comparison only when no folder is shown under that name. The removal test now runs the checkout's omarchy-theme-dir rather than an installed one. Co-authored-by: Cursor <cursoragent@cursor.com>
omarchy theme list shows a folder named tokyo-night- as "Tokyo Night ", with the trailing dash as a space, but omarchy-theme-dir split the folder name with read, which drops it. "Tokyo Night" then found tokyo-night- before the stock tokyo-night, so setting it applied the wrong theme and removing it deleted that folder. Build the shown name word by word, as the list does. Co-authored-by: Cursor <cursoragent@cursor.com>
Collaborator
|
Closing in favour of #18557, which fixes the same thing with less: it tries the exact folder name first, then the existing conversion. This one rewrites the shared omarchy-theme-dir into a 40-line resolver and breaks theme preview for a name wrapped in markup tags. Reviewed by Claude Opus 5.5 with Codex Medium as a second opinion; its independence is not guaranteed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A theme made by hand in a folder with capitals or spaces shows in
omarchy theme list, but setting it by that name fails withTheme 'walk-handmade-theme' does not exist:bin/omarchy-theme-setlowercases the name and turns its spaces into dashes before looking for the folder.Screenshots
Reproduce
cp -r /usr/share/omarchy/themes/gruvbox ~/.config/omarchy/themes/'Walk Handmade Theme'omarchy theme list: it listsWalk Handmade Theme.omarchy theme set 'Walk Handmade Theme': it printsTheme 'walk-handmade-theme' does not existand the theme stays as it was.More cases
A hand-made
Gruvboxfolder beside the bundledgruvbox:omarchy theme set Gruvboxapplies the bundled onePicking a hand-made theme in the theme picker and pressing Enter leaves the theme unchanged
omarchy theme remove 'Walk Kebab Theme'does not find the folderwalk-kebab-themeAlso affected
bin/omarchy-theme-dir: takes only a folder's own name, soomarchy theme dir 'Walk Kebab Theme'prints a bundled path that does not exist; fixed here, and it is now the one lookup set, remove and the preview use.bin/omarchy-dev-theme-preview: kept its own copy of set's conversion, soomarchy dev theme-preview 'Walk Handmade Theme'saysTheme not found; fixed here.Related
omarchy theme removerejects the"Tokyo Night"name its own example uses; this fixes it for user themes and changes the example to"My Theme".omarchy-theme-installlowercase the folder it creates so set could find it.