Skip to content

Commit

Permalink
fix: allow access to the current tab via tabs for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Feb 13, 2024
1 parent 22ecad4 commit 8bf0d64
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions yazi-fm/src/lives/tabs.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down Expand Up @@ -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()
}
Expand Down

0 comments on commit 8bf0d64

Please sign in to comment.