avoid some unnecessary allocations
[?]
Jul 24, 2023, 7:44 AM
SM7UNXQMKBTBJBR7LWL5LV2SSWQ4OGWCUNHYPAZ2DUH5UXIZXBDQCDependencies
- [2]
AQRAWL63don't tolerate Lua comments when parsing commands - [3]
VA7NGQLGignore comments when selecting buffer name - [4]
LRDM35CEapp running again - [5]
GXE3ESLGabstraction: roll forward/back - [6]
BSDXVB3Hbackport some doc updates and renames
Change contents
- edit in live.lua at line 233
-- return the first word - replacement in live.lua at line 238
return buf:gsub('%-%-[^\n]*', ''):match('^%s*(%S+)')-- Return the first word, after skipping Lua comments.if not buf:match('^%s*%-%-') thenreturn buf:match('^%s*(%S+)') -- avoid unnecessary allocationsend-- wastefully strip out comments everywhere, not just at the startbuf = buf:gsub('%-%-[^\n]*', '') -- line commentsreturn buf:match('^%s*(%S+)')