mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
68aa93b254
commit
279d9af329
5 changed files with 7 additions and 7 deletions
|
|
@ -36,11 +36,11 @@ impl IntoLua<'_> for BodyCd<'static> {
|
|||
fn into_lua(self, lua: &Lua) -> mlua::Result<Value> {
|
||||
if let Some(Cow::Owned(url)) = Some(self.url).filter(|_| !self.dummy) {
|
||||
lua.create_table_from([
|
||||
("tab", self.tab.as_usize().into_lua(lua)?),
|
||||
("tab", self.tab.get().into_lua(lua)?),
|
||||
("url", lua.create_any_userdata(url)?.into_lua(lua)?),
|
||||
])?
|
||||
} else {
|
||||
lua.create_table_from([("tab", self.tab.as_usize())])?
|
||||
lua.create_table_from([("tab", self.tab.get())])?
|
||||
}
|
||||
.into_lua(lua)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,11 +32,11 @@ impl IntoLua<'_> for BodyHover<'static> {
|
|||
fn into_lua(self, lua: &Lua) -> mlua::Result<Value> {
|
||||
if let Some(Cow::Owned(url)) = self.url {
|
||||
lua.create_table_from([
|
||||
("tab", self.tab.as_usize().into_lua(lua)?),
|
||||
("tab", self.tab.get().into_lua(lua)?),
|
||||
("url", lua.create_any_userdata(url)?.into_lua(lua)?),
|
||||
])?
|
||||
} else {
|
||||
lua.create_table_from([("tab", self.tab.as_usize())])?
|
||||
lua.create_table_from([("tab", self.tab.get())])?
|
||||
}
|
||||
.into_lua(lua)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ impl Tab {
|
|||
|
||||
pub(super) fn register(lua: &Lua) -> mlua::Result<()> {
|
||||
lua.register_userdata_type::<Self>(|reg| {
|
||||
reg.add_field_method_get("id", |_, me| Ok(me.id.as_usize()));
|
||||
reg.add_field_method_get("id", |_, me| Ok(me.id.get()));
|
||||
reg.add_method("name", |lua, me, ()| {
|
||||
lua.create_string(me.current.url.name().as_encoded_bytes())
|
||||
});
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ impl FilesOp {
|
|||
|
||||
pub fn prepare(cwd: &Url) -> Id {
|
||||
let ticket = FILES_TICKET.next();
|
||||
Self::Part(cwd.clone(), vec![], FILES_TICKET.next()).emit();
|
||||
Self::Part(cwd.clone(), vec![], ticket).emit();
|
||||
ticket
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ pub struct Id(usize);
|
|||
|
||||
impl Id {
|
||||
#[inline]
|
||||
pub fn as_usize(&self) -> usize { self.0 }
|
||||
pub fn get(&self) -> usize { self.0 }
|
||||
}
|
||||
|
||||
impl Display for Id {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue