This commit is contained in:
sxyazi 2025-09-08 23:35:29 +08:00
parent 114f263aa8
commit 44403cbdfc
No known key found for this signature in database

View file

@ -118,7 +118,7 @@ impl Require {
fn absolute_id<'a>(lua: &Lua, id: &'a str) -> mlua::Result<Cow<'a, str>> {
let Some(stripped) = id.strip_prefix('.') else { return Ok(id.into()) };
Ok(if let Some(cur) = runtime!(lua)?.current() {
format!("{cur}.{stripped}").into()
format!("{}.{stripped}", cur.split('.').next().unwrap_or(cur)).into()
} else {
stripped.into()
})