Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork Sync: Update from parent repository #44

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
refactor: processor.lua 支持 iOS (iDvel#1003)
优化候选词写入记录文件, 支持 iOS
  • Loading branch information
boomker authored Aug 29, 2024
commit 4fbd67f1dcd45717330d1d6fb4d5ac94e1a80b27
17 changes: 8 additions & 9 deletions lua/cold_word_drop/processor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@ require("cold_word_drop.metatable")
local processor = {}

local function get_record_filername(record_type)
local path_sep = "/"
local user_data_dir = rime_api:get_user_data_dir()
local user_distribute_name = rime_api:get_distribution_code_name()
if user_distribute_name:lower():match("weasel") then
return string.format("%s\\lua\\cold_word_drop\\%s_words.lua", rime_api:get_user_data_dir(), record_type)
elseif user_distribute_name:lower():match("squirrel") then
return string.format("%s/lua/cold_word_drop/%s_words.lua", rime_api:get_user_data_dir(), record_type)
elseif user_distribute_name:lower():match("fcitx") then
return string.format("%s/lua/cold_word_drop/%s_words.lua", rime_api:get_user_data_dir(), record_type)
elseif user_distribute_name:lower():match("ibus") then
return string.format(
"%s/rime/lua/cold_word_drop/%s_words.lua",
if user_distribute_name:lower():match("weasel") then path_sep = "\\" end
if user_distribute_name:lower():match("ibus") then
return string.format("%s/rime/lua/cold_word_records/%s_words.lua",
os.getenv("HOME") .. "/.config/ibus",
record_type
)
else
local file_path = string.format("%s/lua/cold_word_records/%s_words.lua", user_data_dir, record_type)
return file_path:gsub("/", path_sep)
end
end

Expand Down