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

feat: autoload lua module if the name starts with "*" #189

Merged
merged 1 commit into from
Sep 24, 2022
Merged

Conversation

hchunhui
Copy link
Owner

The ticket.klass of lua component was interpreted as global variable name in lua. The commit distinguishes names starts with "*". They will be interpreted as module names of lua.

The `ticket.klass` of lua component was interpreted as global variable name in
lua. The commit distinguishes names starts with "*". They will be interpreted
as module names of lua.
@hchunhui
Copy link
Owner Author

reference: #158
@shewer 名字前加上 "*" 表示后面的名字需理解为模块名,要用 require 加载。require 之后无需再赋以global name,因此可避免冲突。

@shewer
Copy link
Contributor

shewer commented Sep 12, 2022

reference: #158 @shewer 名字前加上 "*" 表示后面的名字需理解为模块名,要用 require 加载。require 之后无需再赋以global name,因此可避免冲突。

喔了解 主動require 也是可以在不更動rime.lua載入模組

載入錯誤 (仍然是空值) 和 run time error
可以用 property_notifier 送出短訊息嗎
在 segmentor prompt or preedit or candidate.comment 上 hight line

lua_filter 我己PR bypass translation

@shewer
Copy link
Contributor

shewer commented Sep 12, 2022

經測試 可以自載入 :
lua_xxxx@*abc # require 'abc' -- file: lua/abc.lua or lua/abc/init.lua
@*abc.cde # require 'abc.cde' -- file: lua/abc/cde.lua

@hchunhui
Copy link
Owner Author

再留两天看看还有什么意见。没有的话就合并?

@shewer
Copy link
Contributor

shewer commented Sep 17, 2022

lua_translator@*test -- ticket.kless = '*test' ticket.name_space ='*test'
env.name_space 也會是 '*test' 是否要移去
還是由user 重設定 env.name_space

@hchunhui
Copy link
Owner Author

lua_translator@*test -- ticket.kless = '*test' ticket.name_space ='*test' env.name_space 也會是 '*test' 是否要移去 還是由user 重設定 env.name_space

我觉得就保持这样吧,如果 name_space 要设成其它的值就用 lua_translator@*test@new_name_space 这样。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants