diff --git a/CHANGELOG.md b/CHANGELOG.md index aded5892..0a216a76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/): - Rename `name` to `url` for open, fetchers, spotters, preloaders, previewers, filetype, and `globs` icon rules to support virtual file system ([#3034]) - Rename `mime` fetcher to `mime.local`, and introduce `mime.dir` fetcher to support folder MIME types ([#3222]) - Remove `$0` parameter in opener rules to make the `open` command work under empty directories ([#3226]) +- Return `Path` instead of `Url` from `Url:strip_prefix()` to enforce type safety ([#3361]) - Use `body` instead of the term `content` in confirmations ([#2921]) - Use `u16` instead of `u32` as the type of `max_width` and `max_height` options to avoid memory exhaustion ([#3313]) - Implement `__pairs` metamethod instead of `__index` for the callback argument of the `@yank` DDS event ([#2997]) diff --git a/yazi-binding/src/path.rs b/yazi-binding/src/path.rs index a18dbd5e..be37b940 100644 --- a/yazi-binding/src/path.rs +++ b/yazi-binding/src/path.rs @@ -115,6 +115,9 @@ impl UserData for Path { cached_field!(fields, stem, |lua, me| { me.stem().map(|s| lua.create_string(s.encoded_bytes())).transpose() }); + + fields.add_field_method_get("is_absolute", |_, me| Ok(me.is_absolute())); + fields.add_field_method_get("has_root", |_, me| Ok(me.has_root())); } fn add_methods>(methods: &mut M) {