upadte mzte-nv

This commit is contained in:
LordMZTE 2022-11-21 00:24:12 +01:00
parent a17571af2b
commit 4c4139709a
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
3 changed files with 9 additions and 7 deletions

View file

@ -3,6 +3,11 @@ local map = vim.api.nvim_set_keymap
require("nvim-tree").setup {
open_on_setup = not vim.g.started_by_vinput,
open_on_setup_file = false,
actions = {
change_dir = {
global = true,
},
},
view = {
adaptive_size = true,
},

View file

@ -20,15 +20,12 @@ pub fn main() !void {
const input_arg = std.mem.span(std.os.argv[1]);
try doCompile(input_arg);
}
pub fn doCompile(path: []const u8) !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
try doCompile(input_arg, gpa.allocator());
}
const alloc = gpa.allocator();
pub fn doCompile(path: []const u8, alloc: std.mem.Allocator) !void {
var dir = try std.fs.cwd().openIterableDir(path, .{});
defer dir.close();

View file

@ -14,6 +14,6 @@ pub fn luaPush(l: *c.lua_State) void {
fn lCompilePath(l: *c.lua_State) !c_int {
const path = c.luaL_checklstring(l, 1, null);
try compiler.doCompile(std.mem.span(path));
try compiler.doCompile(std.mem.span(path), std.heap.c_allocator);
return 0;
}