From 8ebb0000419fb8efc4430cbeb72b969ce06ddc0a Mon Sep 17 00:00:00 2001 From: kahole Date: Sat, 7 Dec 2019 03:02:04 +0100 Subject: [PATCH] syntax --- .../magit.language-configuration.json | 2 +- package.json | 7 ++----- src/documents/statusDocument.ts | 2 +- syntaxes/magitStatus.tmGrammar.json | 10 +++------- 4 files changed, 7 insertions(+), 14 deletions(-) rename languageConfigurations/magit.json => languages/magit.language-configuration.json (83%) diff --git a/languageConfigurations/magit.json b/languages/magit.language-configuration.json similarity index 83% rename from languageConfigurations/magit.json rename to languages/magit.language-configuration.json index 451592c..d804629 100644 --- a/languageConfigurations/magit.json +++ b/languages/magit.language-configuration.json @@ -2,7 +2,7 @@ "folding": { "markers": { "start": "^(Unstaged changes)|(Recent commits)", - "end": "^.$" + "end": "^\\.$" } } } \ No newline at end of file diff --git a/package.json b/package.json index 81b9609..24c4efb 100644 --- a/package.json +++ b/package.json @@ -38,17 +38,14 @@ "id": "magit-status", "aliases": ["Magit"], "extensions": [".magit"], - "configuration": "./languageConfigurations/magit.json" + "configuration": "./languages/magit.language-configuration.json" } ], "grammars": [ { "language": "magit-status", "scopeName": "source.magit", - "path": "./syntaxes/magitStatus.tmGrammar.json", - "embeddedLanguages": { - "meta.embedded.inline.diff": "source.diff" - } + "path": "./syntaxes/magitStatus.tmGrammar.json" } ], "keybindings": [ diff --git a/src/documents/statusDocument.ts b/src/documents/statusDocument.ts index d959eb0..239e92f 100644 --- a/src/documents/statusDocument.ts +++ b/src/documents/statusDocument.ts @@ -38,7 +38,7 @@ export default class StatusDocument { magitStatus.log .forEach(commit => { this._lines.push(`Recent commits`); - this._lines.push(`${commit.hash.slice(0, 5)} ${commit.message}`); + this._lines.push(`${commit.hash.slice(0, 7)} ${commit.message}`); }); this._lines.push(this.SECTION_FOLD_REGION_END); } diff --git a/syntaxes/magitStatus.tmGrammar.json b/syntaxes/magitStatus.tmGrammar.json index 2a64992..5713533 100644 --- a/syntaxes/magitStatus.tmGrammar.json +++ b/syntaxes/magitStatus.tmGrammar.json @@ -3,24 +3,20 @@ "patterns": [{ "include": "#expression"}, {"include": "#diff" }], "repository": { "expression": { - "patterns": [{ "include": "#sectionHeader" }, { "include": "#branchName" }, { "include": "#changeHeader" }] + "patterns": [{ "include": "#sectionHeader" }, { "include": "#branchName" }] }, "sectionHeader": { "match": "Unstaged changes|Recent commits", - "name": "keyword.sectionHeader" + "name": "keyword.sectionHeader", + "comment": "kan bruke markup.bold.sectionHeader" }, "branchName": { "match": "master", "name": "support.master" }, - "changeHeader": { - "match": "^@@.*", - "name": "support.master" - }, "diff": { "begin": "^@@", "end": "^$", - "name": "source.diff", "patterns": [{ "include": "source.diff"}] } }