diff --git a/lib/common-zig/src/main.zig b/lib/common-zig/src/main.zig index 300f630..a871bcb 100644 --- a/lib/common-zig/src/main.zig +++ b/lib/common-zig/src/main.zig @@ -16,7 +16,7 @@ pub fn logFn( null; const color = log_file == null and stderr_isatty orelse blk: { - const isatty = std.os.isatty(std.os.STDERR_FILENO); + const isatty = std.posix.isatty(std.posix.STDERR_FILENO); stderr_isatty = isatty; break :blk isatty; }; diff --git a/mzte-nv/build.zig b/mzte-nv/build.zig index 955f396..3caef26 100644 --- a/mzte-nv/build.zig +++ b/mzte-nv/build.zig @@ -48,6 +48,8 @@ pub fn build(b: *std.Build) !void { compiler.linkLibC(); compiler.linkSystemLibrary("luajit"); + compiler.root_module.addImport("common", b.dependency("common", .{}).module("common")); + compiler.root_module.unwind_tables = true; b.installArtifact(compiler); diff --git a/mzte-nv/conf/lua/plugins.fnl b/mzte-nv/conf/lua/plugins.fnl index b2aa7c5..f7dc26f 100644 --- a/mzte-nv/conf/lua/plugins.fnl +++ b/mzte-nv/conf/lua/plugins.fnl @@ -65,6 +65,7 @@ (use/mztegit :promise-async) (use/pconf :nvim-ufo :ufo {:after :nvim-lspconfig}) (use/pconf :aerial.nvim :aerial) + (use/mztegit :nvim-nio) ;; dep of dap-ui (use/mztegit :nvim-dap-ui) (use/pconf :nvim-dap :dap) (use/pconf :harpoon :harpoon) diff --git a/mzte-nv/src/compiler.zig b/mzte-nv/src/compiler.zig index e2a6b20..cd2c676 100644 --- a/mzte-nv/src/compiler.zig +++ b/mzte-nv/src/compiler.zig @@ -7,6 +7,7 @@ const log = std.log.scoped(.compiler); pub const std_options = std.Options{ .log_level = .debug, + .logFn = @import("common").logFn, }; pub fn main() !void { diff --git a/mzte-nv/src/modules/jdtls.zig b/mzte-nv/src/modules/jdtls.zig index 8b7cce3..d6da4c5 100644 --- a/mzte-nv/src/modules/jdtls.zig +++ b/mzte-nv/src/modules/jdtls.zig @@ -74,7 +74,7 @@ fn lFindRuntimes(l: *c.lua_State) !c_int { /// https://github.com/dgileadi/vscode-java-decompiler/tree/master/server // TODO: add command to download these maybe? fn lGetBundleInfo(l: *c.lua_State) !c_int { - const home = std.os.getenv("HOME") orelse return error.HomeNotSet; + const home = std.posix.getenv("HOME") orelse return error.HomeNotSet; const bundle_path = try std.fs.path.join( std.heap.c_allocator, @@ -137,10 +137,10 @@ fn lGetBundleInfo(l: *c.lua_State) !c_int { } fn lGetDirs(l: *c.lua_State) !c_int { - const home = std.os.getenv("HOME") orelse return error.HomeNotSet; + const home = std.posix.getenv("HOME") orelse return error.HomeNotSet; var cwd_buf: [256]u8 = undefined; - const cwd_basename = std.fs.path.basename(try std.os.getcwd(&cwd_buf)); + const cwd_basename = std.fs.path.basename(try std.posix.getcwd(&cwd_buf)); const config_path = try std.fs.path.joinZ( std.heap.c_allocator, diff --git a/mzte-nv/src/modules/utils.zig b/mzte-nv/src/modules/utils.zig index c82b0a8..70c98f7 100644 --- a/mzte-nv/src/modules/utils.zig +++ b/mzte-nv/src/modules/utils.zig @@ -14,7 +14,7 @@ pub fn luaPush(l: *c.lua_State) void { /// This is basically a reimplementation of `which`. fn lFindInPath(l: *c.lua_State) !c_int { const bin = ffi.luaCheckstring(l, 1); - const path = std.os.getenv("PATH") orelse return error.PathNotSet; + const path = std.posix.getenv("PATH") orelse return error.PathNotSet; var splits = std.mem.split(u8, path, ":"); while (splits.next()) |p| {