From 8e741599dc7a7fa23795f23b8d442427edc92ca9 Mon Sep 17 00:00:00 2001 From: sum01 Date: Thu, 4 Jan 2018 22:27:09 -0500 Subject: [PATCH 1/2] Fix #980 duplicate import --- cmd/micro/lua.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/micro/lua.go b/cmd/micro/lua.go index fdad4240..d97a1191 100644 --- a/cmd/micro/lua.go +++ b/cmd/micro/lua.go @@ -416,7 +416,6 @@ func importFilePath() *lua.LTable { pkg := L.NewTable() L.SetField(pkg, "Join", luar.New(L, filepath.Join)) - L.SetField(pkg, "Clean", luar.New(L, filepath.Join)) L.SetField(pkg, "Abs", luar.New(L, filepath.Abs)) L.SetField(pkg, "Base", luar.New(L, filepath.Base)) L.SetField(pkg, "Clean", luar.New(L, filepath.Clean)) From 8629357c7089ad656a4791d645e766c9d9c0068b Mon Sep 17 00:00:00 2001 From: sum01 Date: Fri, 5 Jan 2018 03:35:11 -0500 Subject: [PATCH 2/2] Remove weird ignore on git-commit It was needlessly highlighting everything that wasn't a comment. Adds keyword detection for Github-esque issue-closing syntax. Adds missing 'd' and 'drop' highlighting in git-rebase-todo --- runtime/syntax/git-commit.yaml | 20 ++++++++----------- runtime/syntax/git-rebase-todo.yaml | 31 ++++++++++------------------- 2 files changed, 19 insertions(+), 32 deletions(-) diff --git a/runtime/syntax/git-commit.yaml b/runtime/syntax/git-commit.yaml index 222856c1..3429edd2 100644 --- a/runtime/syntax/git-commit.yaml +++ b/runtime/syntax/git-commit.yaml @@ -1,29 +1,25 @@ filetype: git-commit detect: - filename: "COMMIT_EDITMSG|TAG_EDITMSG" + filename: "^(.*[\\/])?(COMMIT_EDITMSG|TAG_EDITMSG)$" rules: - # Commit message - - ignore: ".*" - # Comments - - comment: - start: "^#" - end: "$" - rules: [] # File changes - type.keyword: "#[[:space:]](deleted|modified|new file|renamed):[[:space:]].*" - type.keyword: "#[[:space:]]deleted:" - type.keyword: "#[[:space:]]modified:" - type.keyword: "#[[:space:]]new file:" - type.keyword: "#[[:space:]]renamed:" - # Untracked filenames - - error: "^# [^/?*:;{}\\\\]+\\.[^/?*:;{}\\\\]+$" - type.keyword: "^#[[:space:]]Changes.*[:]" - type.keyword: "^#[[:space:]]Your branch and '[^']+" - type.keyword: "^#[[:space:]]Your branch and '" - type.keyword: "^#[[:space:]]On branch [^ ]+" - type.keyword: "^#[[:space:]]On branch" - # Recolor hash symbols - - special: "#" + # Color keywords for closing issues (such as on Github) + - type.keyword: "\\b(?i)((fix(es|ed)?|close(s|d)?) #[0-9]+)\\b" + # Comments + - comment.line: + start: "^#" + end: "$" + rules: [] diff --git a/runtime/syntax/git-rebase-todo.yaml b/runtime/syntax/git-rebase-todo.yaml index 30ede72a..e2dd588a 100644 --- a/runtime/syntax/git-rebase-todo.yaml +++ b/runtime/syntax/git-rebase-todo.yaml @@ -1,28 +1,19 @@ filetype: git-rebase-todo detect: - filename: "git-rebase-todo" + filename: "^(.*[\\/])?git\\-rebase\\-todo$" rules: + # Rebase commands + - statement: "^(p(ick)?|r(eword)?|e(dit)?|s(quash)?|f(ixup)?|x|exec|d(rop)?)\\b" + # Commit IDs + - identifier: "\\b([0-9a-f]{7,40})\\b" + + # Color keywords for Github (and others) + - type.keyword: "\\b(?i)((fix(es|ed)?|close(s|d)?) #[0-9]+)\\b" + # Comments - - comment: - start: "#" + - comment.line: + start: "^#" end: "$" rules: [] - # Rebase commands - - statement: "^(e|edit) [0-9a-f]{7,40}" - - statement: "^# (e, edit)" - - statement: "^(f|fixup) [0-9a-f]{7,40}" - - statement: "^# (f, fixup)" - - statement: "^(p|pick) [0-9a-f]{7,40}" - - statement: "^# (p, pick)" - - statement: "^(r|reword) [0-9a-f]{7,40}" - - statement: "^# (r, reword)" - - statement: "^(s|squash) [0-9a-f]{7,40}" - - statement: "^# (s, squash)" - - statement: "^(x|exec) [^ ]+ [0-9a-f]{7,40}" - - statement: "^# (x, exec)" - # Recolor hash symbols - - special: "#" - # Commit IDs - - identifier: "[0-9a-f]{7,40}"