aboutsummaryrefslogtreecommitdiffstats
path: root/join.lua
blob: 0d067e77d38574c322222cd8b0c355055c889922 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
script_name = "Join hotkey"
script_description = ""
script_author = "garret1317"
script_version = "1"


local function main(sub, sel)
	for i=#sel,1,-1 do
		local line = sub[sel[i]]
		local prevline = sub[sel[i] -1]

		line.start_time = prevline.start_time
		line.text = prevline.text .. " ".. line.text

		sub[sel[i]] = line
		sub.delete(sel[i]-1)

		sel[i] = sel[i]-1
	end
	return sel, act
end

aegisub.register_macro(script_name, script_description, main)