aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2010-11-30 17:49:07 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2010-11-30 17:49:07 -0500
commitcd23ca3323ce3ade5e83c20bb4d921dc7d45639a (patch)
tree171ed071421096f724ce14b56d8488e751a2122e
parentd955abad5f427b936393ec92028d1ef01192a8da (diff)
downloadtextadept-cd23ca3323ce3ade5e83c20bb4d921dc7d45639a.tar.gz
textadept-cd23ca3323ce3ade5e83c20bb4d921dc7d45639a.zip
Ignore shebang line when checking Lua syntax; modules/lua/commands.lua
-rw-r--r--modules/lua/commands.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/lua/commands.lua b/modules/lua/commands.lua
index 4857126c..1d39bd2e 100644
--- a/modules/lua/commands.lua
+++ b/modules/lua/commands.lua
@@ -139,6 +139,7 @@ events.connect('file_before_save',
local buffer = buffer
buffer:annotation_clear_all()
local text = buffer:get_text()
+ text = text:gsub('^#![^\n]+', '') -- ignore shebang line
local _, err = loadstring(text)
if err then
local line, msg = err:match('^.-:(%d+):%s*(.+)$')