From d6e435706badfee9b96b3cf831c0283a28137eb0 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 16 Oct 2026 22:18:15 -1000 Subject: Find a script's lexer from its shebang line Scintillua's detect reads the first line as well as the name, and without it hooks, bin scripts and anything else lacking an extension stayed plain. --- tests/extensions/test-syntax-highlight.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/extensions/test-syntax-highlight.lua') diff --git a/tests/extensions/test-syntax-highlight.lua b/tests/extensions/test-syntax-highlight.lua index a9e8b36..a87cd80 100644 --- a/tests/extensions/test-syntax-highlight.lua +++ b/tests/extensions/test-syntax-highlight.lua @@ -60,6 +60,10 @@ h.equals("a lexer that raises falls back to escaped text", out, "some <code&g out = render("script.viadetect", "if") h.equals("filename detection picks the lexer", out, "if") +out = render("post-receive", "#!/usr/bin/fake\nif") +h.contains("a shebang picks the lexer of a file with no extension", out, + "if") + out = render("tool.py", "import ") h.equals("an extension with no lexer serves escaped text", out, "import <x>") -- cgit