Skip to content

Commit d992c60

Browse files
committed
status.lua: Move import lines to beginning of file
1 parent 5a62a8e commit d992c60

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

runtime/plugins/status/status.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ VERSION = "1.0.0"
33
local micro = import("micro")
44
local buffer = import("micro/buffer")
55
local config = import("micro/config")
6+
local shell = import("micro/shell")
67
local humanize = import("humanize")
8+
local strings = import("strings")
79

810
function init()
911
micro.SetStatusInfoFn("status.branch")
@@ -34,9 +36,6 @@ end
3436

3537
function branch(b)
3638
if b.Type.Kind ~= buffer.BTInfo then
37-
local shell = import("micro/shell")
38-
local strings = import("strings")
39-
4039
local branch, err = shell.ExecCommand("git", "rev-parse", "--abbrev-ref", "HEAD")
4140
if err == nil then
4241
return strings.TrimSpace(branch)
@@ -47,9 +46,6 @@ end
4746

4847
function hash(b)
4948
if b.Type.Kind ~= 5 then
50-
local shell = import("micro/shell")
51-
local strings = import("strings")
52-
5349
local hash, err = shell.ExecCommand("git", "rev-parse", "--short", "HEAD")
5450
if err == nil then
5551
return strings.TrimSpace(hash)

0 commit comments

Comments
 (0)