Skip to content

Instantly share code, notes, and snippets.

@torque
Created December 3, 2012 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torque/4191807 to your computer and use it in GitHub Desktop.
Save torque/4191807 to your computer and use it in GitHub Desktop.
-- split all selected lines at \N
function argh(sub,sel)
for i = #sel,1,-1 do
local v = sel[i]
local line = sub[v]
line.text = line.text:gsub("\\[Nn]",string.char(6))
for a in line.text:reverse():gfind(("[^%s]+"):format(string.char(6))) do
line.text = a:reverse()
sub.insert(v+1,line)
end
sub.delete(v)
end
end
aegisub.register_macro("split errything","do it",argh)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment