diff --git a/pkgbuilds/rime-ice-installer/PKGBUILD b/pkgbuilds/rime-ice-installer/PKGBUILD index 23f5ba8..d24de1c 100644 --- a/pkgbuilds/rime-ice-installer/PKGBUILD +++ b/pkgbuilds/rime-ice-installer/PKGBUILD @@ -12,7 +12,7 @@ makedepends=('go') source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz" 'omarchy-offline.patch') sha256sums=('64008e326ece22d156c0fb634cc784c60a41c48858eb0d949349b41dfd0c5477' - '95f4fd44200901a4e5499535da5de337cd1d5102d87cac7d57b51b70fb9ffe69') + 'f2b9a8ec97796d4432f3461396fa0332901624e70c873187703b85d61478c384') _setup_go_env() { export GOPATH="$srcdir" diff --git a/pkgbuilds/rime-ice-installer/omarchy-offline.patch b/pkgbuilds/rime-ice-installer/omarchy-offline.patch index 4d6017a..eb92e4b 100644 --- a/pkgbuilds/rime-ice-installer/omarchy-offline.patch +++ b/pkgbuilds/rime-ice-installer/omarchy-offline.patch @@ -52,22 +52,10 @@ index e3554e8..2efc8c2 100644 type DetectedEnv struct { diff --git a/internal/fcitx/fcitx.go b/internal/fcitx/fcitx.go -index fba202a..9710fe3 100644 +index fba202a..f252ca1 100644 --- a/internal/fcitx/fcitx.go +++ b/internal/fcitx/fcitx.go -@@ -25,6 +25,11 @@ var pacmanPackages = []string{ - "opencc", - } - -+func init() { -+ // fcitx5 reads "key = value" as the key "key ". -+ ini.PrettyFormat = false -+} -+ - const ( - managedBlockStart = "# >>> rime-ice-installer ime begin >>>" - managedBlockEnd = "# <<< rime-ice-installer ime end <<<" -@@ -34,10 +39,23 @@ const ( +@@ -34,10 +34,23 @@ const ( defaultGroupName = "Default" ) @@ -95,50 +83,6 @@ index fba202a..9710fe3 100644 } if !env.HasOctagramPlugin { -diff --git a/internal/fcitx/ini_format_test.go b/internal/fcitx/ini_format_test.go -new file mode 100644 -index 0000000..3081d96 ---- /dev/null -+++ b/internal/fcitx/ini_format_test.go -@@ -0,0 +1,38 @@ -+package fcitx -+ -+import ( -+ "os" -+ "path/filepath" -+ "strings" -+ "testing" -+) -+ -+func TestConfigFilesUseFcitxKeyValueFormat(t *testing.T) { -+ dir := t.TempDir() -+ config := filepath.Join(dir, "config") -+ profile := filepath.Join(dir, "profile") -+ if err := ensureGlobalConfig(config); err != nil { -+ t.Fatal(err) -+ } -+ if err := ensureProfile(profile); err != nil { -+ t.Fatal(err) -+ } -+ -+ for path, lines := range map[string][]string{ -+ config: {"0=Control+space", "ModifierOnlyKeyTimeout=-1"}, -+ profile: {"Name=" + defaultGroupName, "Default Layout=us", "DefaultIM=rime", "Name=" + keyboardUS, "Name=rime"}, -+ } { -+ content, err := os.ReadFile(path) -+ if err != nil { -+ t.Fatal(err) -+ } -+ if strings.Contains(string(content), " = ") { -+ t.Fatalf("%s pads \"=\" with spaces, which fcitx5 keeps in the key name:\n%s", filepath.Base(path), content) -+ } -+ for _, line := range lines { -+ if !strings.Contains("\n"+string(content)+"\n", "\n"+line+"\n") { -+ t.Fatalf("%s is missing the line %q:\n%s", filepath.Base(path), line, content) -+ } -+ } -+ } -+} diff --git a/internal/rime/asset_dir_test.go b/internal/rime/asset_dir_test.go new file mode 100644 index 0000000..9e66346