From 437221f09fae0fad1ab9e856265439296080c512 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 4 Nov 2016 13:00:21 +0900 Subject: [PATCH] Fix micro/init.lua Local functions must be defined before used (not for non-local functions). --- micro/init.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/micro/init.lua b/micro/init.lua index 46185ec..b36e8f8 100644 --- a/micro/init.lua +++ b/micro/init.lua @@ -1,21 +1,22 @@ -- ec = require("editorconfig_core") +local function GetProperties(fullpath) + local file = io.popen("echo fullpath: " .. fullpath, "r") + local output = file:read("*all") + file:close() + return output +end + function onViewOpen(view) -- Is this portable? (work on windows?) local pwd = os.getenv("PWD") local filename = view.Buf.Path -- prop, names = ec.parse(filepath) local fullpath = JoinPaths(pwd, filename) - local out = getProperties(fullpath) + local out = GetProperties(fullpath) messenger:Message("view.Buf.Path: " .. out) end -local function getProperties(fullpath) - local file = io.popen("echo fullpath: " .. fullpath, "r") - local output = file:read("*all") - file:close() - return output -end function onSave(view)