]> git.lizzy.rs Git - micro.git/commitdiff
Replaced tmp directory with file directory
authorDaniel Power <me@danielpower.ca>
Sun, 26 Feb 2017 05:51:19 +0000 (02:21 -0330)
committerDaniel Power <me@danielpower.ca>
Sun, 26 Feb 2017 05:51:19 +0000 (02:21 -0330)
runtime/plugins/linter/linter.lua

index 2a231af0e98a08aee95ee402c2e541c446e5d23b..c97a898db4d5924b7d2b2278641793d6d8545333 100644 (file)
@@ -12,15 +12,15 @@ end
 function runLinter()
     local ft = CurView().Buf:FileType()
     local file = CurView().Buf.Path
-    local devnull = "/dev/null"
-    local temp = os.getenv("TMPDIR")
+    local dir = DirectoryName(file)
     if OS == "windows" then
         devnull = "NUL"
-        temp = os.getenv("TEMP")
+    else
+       devnull = "/dev/null"
     end
     if ft == "go" then
         lint("gobuild", "go", {"build", "-o", devnull}, "%f:%l: %m")
-        lint("golint", "golint", {CurView().Buf.Path}, "%f:%l:%d+: %m")
+        lint("golint", "golint", {file}, "%f:%l:%d+: %m")
     elseif ft == "lua" then
         lint("luacheck", "luacheck", {"--no-color", file}, "%f:%l:%d+: %m")
     elseif ft == "python" then
@@ -38,7 +38,7 @@ function runLinter()
     elseif ft == "d" then
         lint("dmd", "dmd", {"-color=off", "-o-", "-w", "-wi", "-c", file}, "%f%(%l%):.+: %m")
     elseif ft == "java" then
-        lint("javac", "javac", {"-d", temp, file}, "%f:%l: error: %m")
+        lint("javac", "javac", {"-d", dir, file}, "%f:%l: error: %m")
     elseif ft == "javascript" then
         lint("jshint", "jshint", {file}, "%f: line %l,.+, %m")
     elseif ft == "nim" then