mirror of
https://github.com/felixangell/phi.git
synced 2024-09-11 15:55:25 +03:00
toml stuff
This commit is contained in:
parent
b654a4918d
commit
f1c4edfec4
@ -21,6 +21,9 @@ always_render = true
|
||||
syntax_highlighting = true
|
||||
|
||||
[file_associations]
|
||||
[file_associations.toml]
|
||||
extensions = [".toml"]
|
||||
|
||||
[file_associations.c]
|
||||
extensions = [".c", ".h", ".cc"]
|
||||
|
||||
|
@ -13,6 +13,21 @@ func RegisterSyntax(name string, s string) {
|
||||
}
|
||||
|
||||
func init() {
|
||||
// TOML
|
||||
RegisterSyntax("toml", `[syntax.toml]
|
||||
[syntax.declaration]
|
||||
colouring = 0xf8f273
|
||||
pattern = '(\[)(.*)(\])'
|
||||
|
||||
[syntax.identifier]
|
||||
colouring = 0xf0a400
|
||||
pattern = '\b([a-z]|[A-Z])+(_|([a-z]|[A-Z])+)*\b'
|
||||
|
||||
[syntax.symbol]
|
||||
match = "="
|
||||
colouring = 0xf8f273
|
||||
`)
|
||||
|
||||
// C LANGUAGE SYNTAX HIGHLIGHTING
|
||||
|
||||
RegisterSyntax("c", `[syntax.c]
|
||||
|
@ -833,7 +833,11 @@ func (b *Buffer) renderAt(ctx *strife.Renderer, rx int, ry int) {
|
||||
|
||||
if b.cfg.Editor.Highlight_Line && b.HasFocus {
|
||||
ctx.SetColor(strife.Black) // highlight_line_col?
|
||||
ctx.Rect(ex+rx, ey+(ry+b.curs.ry*last_h)-(b.cam.y*last_h), b.w, last_h, strife.Fill)
|
||||
|
||||
highlightLinePosY := ey + (ry + b.curs.ry*last_h) - (b.cam.y * last_h)
|
||||
highlightLinePosX := ex + rx
|
||||
|
||||
ctx.Rect(highlightLinePosX, highlightLinePosY, b.w, last_h, strife.Fill)
|
||||
}
|
||||
|
||||
// render the ol' cursor
|
||||
|
Loading…
Reference in New Issue
Block a user