From 8bf0d6428fd7fb88bb99fed484c8a4d3be87d03c Mon Sep 17 00:00:00 2001 From: sxyazi Date: Tue, 13 Feb 2024 16:19:34 +0800 Subject: [PATCH] fix: allow access to the current tab via `tabs` for consistency --- yazi-fm/src/lives/tabs.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/yazi-fm/src/lives/tabs.rs b/yazi-fm/src/lives/tabs.rs index 8f48170b..40f2ba3d 100644 --- a/yazi-fm/src/lives/tabs.rs +++ b/yazi-fm/src/lives/tabs.rs @@ -1,6 +1,6 @@ use std::ops::Deref; -use mlua::{AnyUserData, ExternalError, Lua, MetaMethod, UserDataFields, UserDataMethods}; +use mlua::{AnyUserData, Lua, MetaMethod, UserDataFields, UserDataMethods}; use super::{Tab, SCOPE}; @@ -29,8 +29,6 @@ impl Tabs { reg.add_meta_method(MetaMethod::Index, |_, me, idx: usize| { if idx > me.len() || idx == 0 { Ok(None) - } else if idx - 1 == me.idx { - Err("Use `active` instead of `tabs` to access the current tab".into_lua_err()) } else { Some(Tab::make(&me[idx - 1])).transpose() }