mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-21 00:07:16 +09:00
status.lua: Move import lines to beginning of file
This commit is contained in:
@@ -3,7 +3,9 @@ VERSION = "1.0.0"
|
||||
local micro = import("micro")
|
||||
local buffer = import("micro/buffer")
|
||||
local config = import("micro/config")
|
||||
local shell = import("micro/shell")
|
||||
local humanize = import("humanize")
|
||||
local strings = import("strings")
|
||||
|
||||
function init()
|
||||
micro.SetStatusInfoFn("status.branch")
|
||||
@@ -34,9 +36,6 @@ end
|
||||
|
||||
function branch(b)
|
||||
if b.Type.Kind ~= buffer.BTInfo then
|
||||
local shell = import("micro/shell")
|
||||
local strings = import("strings")
|
||||
|
||||
local branch, err = shell.ExecCommand("git", "rev-parse", "--abbrev-ref", "HEAD")
|
||||
if err == nil then
|
||||
return strings.TrimSpace(branch)
|
||||
@@ -47,9 +46,6 @@ end
|
||||
|
||||
function hash(b)
|
||||
if b.Type.Kind ~= 5 then
|
||||
local shell = import("micro/shell")
|
||||
local strings = import("strings")
|
||||
|
||||
local hash, err = shell.ExecCommand("git", "rev-parse", "--short", "HEAD")
|
||||
if err == nil then
|
||||
return strings.TrimSpace(hash)
|
||||
|
||||
Reference in New Issue
Block a user