mirror of
https://github.com/zellij-org/zellij.git
synced 2024-12-25 02:06:19 +03:00
No more glob imports in the register_tile! macro
This commit is contained in:
parent
4592f12349
commit
1275a9e73a
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "mosaic-tile"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
authors = ["Brooks J Rady <b.j.rady@gmail.com>"]
|
||||
edition = "2018"
|
||||
description = "A small client-side library for writing mosaic plugins (tiles)"
|
||||
|
@ -12,11 +12,8 @@ pub trait MosaicTile {
|
||||
#[macro_export]
|
||||
macro_rules! register_tile {
|
||||
($t:ty) => {
|
||||
use mosaic_tile::*;
|
||||
|
||||
use std::cell::RefCell;
|
||||
thread_local! {
|
||||
static STATE: RefCell<$t> = RefCell::new(Default::default());
|
||||
static STATE: std::cell::RefCell<$t> = std::cell::RefCell::new(Default::default());
|
||||
}
|
||||
|
||||
fn main() {
|
||||
@ -35,14 +32,14 @@ macro_rules! register_tile {
|
||||
#[no_mangle]
|
||||
pub fn handle_key() {
|
||||
STATE.with(|state| {
|
||||
state.borrow_mut().handle_key(get_key());
|
||||
state.borrow_mut().handle_key($crate::get_key());
|
||||
});
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub fn handle_global_key() {
|
||||
STATE.with(|state| {
|
||||
state.borrow_mut().handle_global_key(get_key());
|
||||
state.borrow_mut().handle_global_key($crate::get_key());
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user