mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-21 23:01:05 +00:00
fix: allow access to the current tab via tabs for consistency
This commit is contained in:
parent
22ecad47ab
commit
8bf0d6428f
1 changed files with 1 additions and 3 deletions
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue