From 91aa1787531bc5c4f114564bfddbee327c26b1ff Mon Sep 17 00:00:00 2001 From: Joop Kiefte Date: Tue, 28 Sep 2021 01:36:50 +0100 Subject: [PATCH 1/4] Create fountain.lua --- plugins/fountain.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 plugins/fountain.lua diff --git a/plugins/fountain.lua b/plugins/fountain.lua new file mode 100644 index 00000000..0465df34 --- /dev/null +++ b/plugins/fountain.lua @@ -0,0 +1,27 @@ +local syntax = require "core.syntax" +local common = require "core.common" +local style = require "core.style" + +style.syntax["header"] = { common.color "#66FF66" } +style.syntax["property"] = { common.color "#888888" } +style.syntax["paren"] = { common.color "#AAAAAA" } +style.syntax["caps"] = { common.color "#6666FF" } + +syntax.add { + files = { "%.fountain$" }, + patterns = { + { pattern = { "/%*", "%*/" }, type = "comment" }, + { pattern = { "%[%[", "%]%]" }, type = "string" }, + { pattern = { "%(", "%)", "\\" }, type = "paren" }, + { pattern = "INT[%. ].*\n", type = "function" }, + { pattern = "EXT[%. ].*\n", type = "function" }, + { pattern = "EST[%. ].*\n", type = "function" }, + { pattern = "INT%.?/EXT[%. ].*\n", type = "function" }, + { pattern = "I/E[%. ].*\n", type = "function" }, + { pattern = "#.*\n", type = "header" }, + { pattern = ".*%: .*\n", type = "property" }, + { pattern = "[A-Z][^a-z]+\n", type = "caps" }, + }, + symbols = { + }, +} From d164863ca8f962e677cd40c038e862e1f39970dc Mon Sep 17 00:00:00 2001 From: Joop Kiefte Date: Tue, 28 Sep 2021 01:41:43 +0100 Subject: [PATCH 2/4] Fountain support README change --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fd8bc210..90dab88b 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Plugin | Description [`eval`](plugins/eval.lua?raw=1) | Replaces selected Lua code with its evaluated result [`exec`](plugins/exec.lua?raw=1) | Runs selected text through shell command and replaces with result [`fallbackfonts`](https://github.com/takase1121/lite-fallback-fonts)* | Adds support for fallback fonts *([gif](https://raw.githubusercontent.com/takase1121/lite-fallback-fonts/master/assets/Iw18fI57J0.gif))* +[`fountain`](plugins/fountain.lua?raw=1) | Adds rudimentary fountain syntax coloring [`ghmarkdown`](plugins/ghmarkdown.lua?raw=1) | Opens a preview of the current markdown file in a browser window *([screenshot](https://user-images.githubusercontent.com/3920290/82754898-f7394600-9dc7-11ea-8278-2305363ed372.png))* [`gitstatus`](plugins/gitstatus.lua?raw=1) | Displays git branch and insert/delete count in status bar *([screenshot](https://user-images.githubusercontent.com/3920290/81107223-bcea3080-8f0e-11ea-8fc7-d03173f42e33.png))* [`gofmt`](plugins/gofmt.lua?raw=1) | Auto-formats the current go file, adds the missing imports and the missing return cases From 700d04cb757acea40cfbfc25bf10e8a25df39dc2 Mon Sep 17 00:00:00 2001 From: Joop Kiefte Date: Tue, 28 Sep 2021 01:50:05 +0100 Subject: [PATCH 3/4] Change name from fountain to language_fountain --- README.md | 2 +- plugins/language_fountain.lua | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 plugins/language_fountain.lua diff --git a/README.md b/README.md index 90dab88b..5c372150 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,6 @@ Plugin | Description [`eval`](plugins/eval.lua?raw=1) | Replaces selected Lua code with its evaluated result [`exec`](plugins/exec.lua?raw=1) | Runs selected text through shell command and replaces with result [`fallbackfonts`](https://github.com/takase1121/lite-fallback-fonts)* | Adds support for fallback fonts *([gif](https://raw.githubusercontent.com/takase1121/lite-fallback-fonts/master/assets/Iw18fI57J0.gif))* -[`fountain`](plugins/fountain.lua?raw=1) | Adds rudimentary fountain syntax coloring [`ghmarkdown`](plugins/ghmarkdown.lua?raw=1) | Opens a preview of the current markdown file in a browser window *([screenshot](https://user-images.githubusercontent.com/3920290/82754898-f7394600-9dc7-11ea-8278-2305363ed372.png))* [`gitstatus`](plugins/gitstatus.lua?raw=1) | Displays git branch and insert/delete count in status bar *([screenshot](https://user-images.githubusercontent.com/3920290/81107223-bcea3080-8f0e-11ea-8fc7-d03173f42e33.png))* [`gofmt`](plugins/gofmt.lua?raw=1) | Auto-formats the current go file, adds the missing imports and the missing return cases @@ -48,6 +47,7 @@ Plugin | Description [`language_elm`](plugins/language_elm.lua?raw=1) | Syntax for the [Elm](https://elm-lang.org) programming language [`language_fe`](plugins/language_fe.lua?raw=1) | Syntax for the [fe](https://github.com/rxi/fe) programming language [`language_fennel`](plugins/language_fennel.lua?raw=1) | Syntax for the [fennel](https://fennel-lang.org) programming language +[`language_fountain`](plugins/language_fountain.lua?raw=1) | Adds rudimentary fountain syntax coloring [`language_gdscript`](plugins/language_gdscript.lua?raw=1) | Syntax for the [Godot Engine](https://godotengine.org/)'s GDScript scripting language [`language_glsl`](plugins/language_glsl.lua?raw=1) | Syntax for the [GLSL](https://www.khronos.org/registry/OpenGL/specs/gl/) programming language [`language_go`](plugins/language_go.lua?raw=1) | Syntax for the [Go](https://golang.org/) programming language diff --git a/plugins/language_fountain.lua b/plugins/language_fountain.lua new file mode 100644 index 00000000..0465df34 --- /dev/null +++ b/plugins/language_fountain.lua @@ -0,0 +1,27 @@ +local syntax = require "core.syntax" +local common = require "core.common" +local style = require "core.style" + +style.syntax["header"] = { common.color "#66FF66" } +style.syntax["property"] = { common.color "#888888" } +style.syntax["paren"] = { common.color "#AAAAAA" } +style.syntax["caps"] = { common.color "#6666FF" } + +syntax.add { + files = { "%.fountain$" }, + patterns = { + { pattern = { "/%*", "%*/" }, type = "comment" }, + { pattern = { "%[%[", "%]%]" }, type = "string" }, + { pattern = { "%(", "%)", "\\" }, type = "paren" }, + { pattern = "INT[%. ].*\n", type = "function" }, + { pattern = "EXT[%. ].*\n", type = "function" }, + { pattern = "EST[%. ].*\n", type = "function" }, + { pattern = "INT%.?/EXT[%. ].*\n", type = "function" }, + { pattern = "I/E[%. ].*\n", type = "function" }, + { pattern = "#.*\n", type = "header" }, + { pattern = ".*%: .*\n", type = "property" }, + { pattern = "[A-Z][^a-z]+\n", type = "caps" }, + }, + symbols = { + }, +} From a18b94de275c83205aa240034740c23885cbfb9a Mon Sep 17 00:00:00 2001 From: Joop Kiefte Date: Fri, 1 Oct 2021 00:17:08 +0100 Subject: [PATCH 4/4] Small Fountain improvements --- README.md | 2 +- plugins/fountain.lua | 27 --------------------------- plugins/language_fountain.lua | 6 ++++-- 3 files changed, 5 insertions(+), 30 deletions(-) delete mode 100644 plugins/fountain.lua diff --git a/README.md b/README.md index 5c372150..8e240008 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Plugin | Description [`language_elm`](plugins/language_elm.lua?raw=1) | Syntax for the [Elm](https://elm-lang.org) programming language [`language_fe`](plugins/language_fe.lua?raw=1) | Syntax for the [fe](https://github.com/rxi/fe) programming language [`language_fennel`](plugins/language_fennel.lua?raw=1) | Syntax for the [fennel](https://fennel-lang.org) programming language -[`language_fountain`](plugins/language_fountain.lua?raw=1) | Adds rudimentary fountain syntax coloring +[`language_fountain`](plugins/language_fountain.lua?raw=1) | Syntax for the [Fountain](https://fountain.io) screenplay Markdown syntax [`language_gdscript`](plugins/language_gdscript.lua?raw=1) | Syntax for the [Godot Engine](https://godotengine.org/)'s GDScript scripting language [`language_glsl`](plugins/language_glsl.lua?raw=1) | Syntax for the [GLSL](https://www.khronos.org/registry/OpenGL/specs/gl/) programming language [`language_go`](plugins/language_go.lua?raw=1) | Syntax for the [Go](https://golang.org/) programming language diff --git a/plugins/fountain.lua b/plugins/fountain.lua deleted file mode 100644 index 0465df34..00000000 --- a/plugins/fountain.lua +++ /dev/null @@ -1,27 +0,0 @@ -local syntax = require "core.syntax" -local common = require "core.common" -local style = require "core.style" - -style.syntax["header"] = { common.color "#66FF66" } -style.syntax["property"] = { common.color "#888888" } -style.syntax["paren"] = { common.color "#AAAAAA" } -style.syntax["caps"] = { common.color "#6666FF" } - -syntax.add { - files = { "%.fountain$" }, - patterns = { - { pattern = { "/%*", "%*/" }, type = "comment" }, - { pattern = { "%[%[", "%]%]" }, type = "string" }, - { pattern = { "%(", "%)", "\\" }, type = "paren" }, - { pattern = "INT[%. ].*\n", type = "function" }, - { pattern = "EXT[%. ].*\n", type = "function" }, - { pattern = "EST[%. ].*\n", type = "function" }, - { pattern = "INT%.?/EXT[%. ].*\n", type = "function" }, - { pattern = "I/E[%. ].*\n", type = "function" }, - { pattern = "#.*\n", type = "header" }, - { pattern = ".*%: .*\n", type = "property" }, - { pattern = "[A-Z][^a-z]+\n", type = "caps" }, - }, - symbols = { - }, -} diff --git a/plugins/language_fountain.lua b/plugins/language_fountain.lua index 0465df34..7811b021 100644 --- a/plugins/language_fountain.lua +++ b/plugins/language_fountain.lua @@ -13,14 +13,16 @@ syntax.add { { pattern = { "/%*", "%*/" }, type = "comment" }, { pattern = { "%[%[", "%]%]" }, type = "string" }, { pattern = { "%(", "%)", "\\" }, type = "paren" }, + { pattern = "#.*\n", type = "header" }, + { pattern = "[a-zA-Z ]+%: .*\n", type = "property" }, + { pattern = "[^a-zA-Z ]+.*%: .*\n", type = "normal" }, { pattern = "INT[%. ].*\n", type = "function" }, { pattern = "EXT[%. ].*\n", type = "function" }, { pattern = "EST[%. ].*\n", type = "function" }, { pattern = "INT%.?/EXT[%. ].*\n", type = "function" }, { pattern = "I/E[%. ].*\n", type = "function" }, - { pattern = "#.*\n", type = "header" }, - { pattern = ".*%: .*\n", type = "property" }, { pattern = "[A-Z][^a-z]+\n", type = "caps" }, + }, symbols = { },