Skip to content

Commit

Permalink
fixed serious lua error in rust config
Browse files Browse the repository at this point in the history
  • Loading branch information
curlpipe committed Sep 30, 2024
1 parent cfb361b commit 20cf565
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exclude = ["cactus"]

[package]
name = "ox"
version = "0.6.3"
version = "0.6.4"
edition = "2021"
authors = ["Curlpipe <[email protected]>"]
description = "A Rust powered text editor."
Expand Down
3 changes: 3 additions & 0 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ pub const PLUGIN_BOOTSTRAP: &str = include_str!("../plugin/bootstrap.lua");
/// This contains the code for running the plugins
pub const PLUGIN_RUN: &str = include_str!("../plugin/run.lua");

/// This contains the code for running the plugins
pub const PLUGIN_NETWORKING: &str = include_str!("../plugin/networking.lua");

/// This contains the code for running the plugins
pub const PLUGIN_MANAGER: &str = include_str!("../plugin/plugin_manager.lua");

Expand Down
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ mod ui;

use cli::CommandLineInterface;
use config::{
key_to_string, run_key, run_key_before, PLUGIN_BOOTSTRAP, PLUGIN_MANAGER, PLUGIN_RUN,
key_to_string, run_key, run_key_before, PLUGIN_BOOTSTRAP, PLUGIN_MANAGER, PLUGIN_NETWORKING,
PLUGIN_RUN,
};
use crossterm::event::Event as CEvent;
use editor::Editor;
Expand Down Expand Up @@ -58,6 +59,9 @@ fn run(cli: &CommandLineInterface) -> Result<()> {
handle_lua_error(&editor, "configuration", Err(err));
};

// Inject the networking library for plug-ins to use
handle_lua_error(&editor, "", lua.load(PLUGIN_NETWORKING).exec());

// Open files user has asked to open
for (c, file) in cli.to_open.iter().enumerate() {
// Open the file
Expand Down
3 changes: 0 additions & 3 deletions src/plugin/bootstrap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ plugins = {}
builtins = {}
plugin_issues = false

-- Import plug-in api components
http = require('src/plugin/networking')

function load_plugin(base)
path_cross = base
path_unix = home .. "/.config/ox/" .. base
Expand Down
2 changes: 0 additions & 2 deletions src/plugin/networking.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,3 @@ function http.delete(url)
end
return execute(cmd)
end

return http

0 comments on commit 20cf565

Please sign in to comment.