Rework shared commit editors (#24274)
Rework of https://github.com/zed-industries/zed/pull/24130 Uses https://github.com/d1y/git_firefly/tree/1033c0b57ec88a002cb68efc64c8d9bf5c212e30 `COMMIT_EDITMSG` language-related definitions (thanks @d1y ) Instead of using real `.git/COMMIT_EDITMSG` file, create a buffer without FS representation, stored in the `Repository` and shared the regular way via the `BufferStore`. Adds a knowledge of what `Git Commit` language is, and uses it in the buffers which are rendered in the git panel. Release Notes: - N/A --------- Co-authored-by: Conrad Irwin <conrad@zed.dev> Co-authored-by: d1y <chenhonzhou@gmail.com> Co-authored-by: Smit <smit@zed.dev>
This commit is contained in:
co-authored by
Conrad Irwin
d1y
Smit
parent
da4bad3a55
commit
868e3f75b2
@@ -0,0 +1,18 @@
|
||||
name = "Git Commit"
|
||||
grammar = "git_commit"
|
||||
path_suffixes = [
|
||||
"TAG_EDITMSG",
|
||||
"MERGE_MSG",
|
||||
"COMMIT_EDITMSG",
|
||||
"NOTES_EDITMSG",
|
||||
"EDIT_DESCRIPTION",
|
||||
]
|
||||
line_comments = ["#"]
|
||||
brackets = [
|
||||
{ start = "(", end = ")", close = true, newline = false },
|
||||
{ start = "`", end = "`", close = true, newline = false },
|
||||
{ start = "\"", end = "\"", close = true, newline = false },
|
||||
{ start = "'", end = "'", close = true, newline = false },
|
||||
{ start = "{", end = "}", close = true, newline = false },
|
||||
{ start = "[", end = "]", close = true, newline = false },
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
(subject) @markup.heading
|
||||
(path) @string.special.path
|
||||
(branch) @string.special.symbol
|
||||
(commit) @constant
|
||||
(item) @markup.link.url
|
||||
(header) @tag
|
||||
|
||||
(change kind: "new file" @diff.plus)
|
||||
(change kind: "deleted" @diff.minus)
|
||||
(change kind: "modified" @diff.delta)
|
||||
(change kind: "renamed" @diff.delta.moved)
|
||||
|
||||
(trailer
|
||||
key: (trailer_key) @variable.other.member
|
||||
value: (trailer_value) @string)
|
||||
|
||||
[":" "=" "->" (scissors)] @punctuation.delimiter
|
||||
(comment) @comment
|
||||
@@ -0,0 +1,5 @@
|
||||
((scissors) @content
|
||||
(#set! "language" "diff"))
|
||||
|
||||
((rebase_command) @content
|
||||
(#set! "language" "git_rebase"))
|
||||
Reference in New Issue
Block a user