don't tolerate Lua comments when parsing commands
We only care about Lua comments when the message doesn't start with a command.
This commit is contained in:
parent
6679c6e545
commit
d16eba699f
7
live.lua
7
live.lua
|
@ -196,7 +196,8 @@ function live.run(buf)
|
|||
live.send_to_driver(contents)
|
||||
-- other commands go here
|
||||
else
|
||||
local definition_name = cmd
|
||||
local definition_name = live.get_definition_name_from_buffer(buf)
|
||||
print('definition name is '..definition_name)
|
||||
if Live.frozen_definitions[definition_name] then
|
||||
live.send_to_driver('ERROR definition '..definition_name..' is part of Freewheeling infrastructure and cannot be safely edited live.')
|
||||
return
|
||||
|
@ -224,6 +225,10 @@ function live.run(buf)
|
|||
end
|
||||
|
||||
function live.get_cmd_from_buffer(buf)
|
||||
return buf:match('^%s*(%S+)')
|
||||
end
|
||||
|
||||
function live.get_definition_name_from_buffer(buf)
|
||||
return buf:gsub('%-%-[^\n]*', ''):match('^%s*(%S+)')
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue