summaryrefslogtreecommitdiff
path: root/src/widgets/luaeditor/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/luaeditor/mod.rs')
-rw-r--r--src/widgets/luaeditor/mod.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/widgets/luaeditor/mod.rs b/src/widgets/luaeditor/mod.rs
index a24c6e7..d553734 100644
--- a/src/widgets/luaeditor/mod.rs
+++ b/src/widgets/luaeditor/mod.rs
@@ -38,12 +38,12 @@ impl LuaEditor {
if populate {
match event.code {
- KeyCode::Char(c) => GlobalState::instance_mut().editor.buffer.insert(c),
+ KeyCode::Char(c) => GlobalState::get().editor.buffer.insert(c),
KeyCode::Backspace => {
- GlobalState::instance_mut().editor.buffer.delete();
+ GlobalState::get().editor.buffer.delete();
}
KeyCode::Enter => {
- GlobalState::instance_mut().editor.buffer.insert('\n');
+ GlobalState::get().editor.buffer.insert('\n');
}
_ => {}
}
@@ -51,7 +51,7 @@ impl LuaEditor {
}
pub fn render_cursor(&self) -> Option<TuiCursor> {
- let state = GlobalState::instance();
+ let state = GlobalState::get();
let buffer = &state.editor.buffer;
let nr_width = (buffer.lines().len().to_string().len() + 1).max(4) as u16;
let x = buffer.cursor().x()
@@ -73,10 +73,10 @@ impl Widget for &mut LuaEditor {
Self: Sized,
{
{
- let state = GlobalState::instance();
+ let state = GlobalState::get();
let buffer = &state.editor.buffer;
- let config = GlobalConfig::instance();
+ let config = GlobalConfig::get();
let theme = &config.theme.editor;
let inner_area = self.bar.area(area);