From 8451de1b2e4631ff29f1d48ae34367ea0ac4a3eb Mon Sep 17 00:00:00 2001 From: garret Date: Sat, 21 Jan 2023 02:33:35 +0000 Subject: em-dash: minor fixes on replace function fix inconsistent indentation with the rest of the script, and itself made it a local function --- macros/em-dash.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'macros') diff --git a/macros/em-dash.lua b/macros/em-dash.lua index 3dfe696..f175ba4 100644 --- a/macros/em-dash.lua +++ b/macros/em-dash.lua @@ -1,7 +1,7 @@ script_name = "Em-dash" script_description = "I do not have an em-dash key on my keyboard" script_author = "garret" -script_version = "2.0.0" +script_version = "2.0.1" local em = "—" @@ -17,14 +17,14 @@ local function append(sub, sel) aegisub.set_undo_point(script_name) end -function replace(sub, sel) - for si, li in ipairs(sel) do - local line = sub[li] - local text = sub[li].text - text = text:gsub("%-%-",em) - line.text=text - sub[li] = line - end +local function replace(sub, sel) + for si, li in ipairs(sel) do + local line = sub[li] + local text = sub[li].text + text = text:gsub("%-%-",em) + line.text=text + sub[li] = line + end aegisub.set_undo_point(script_name) end -- cgit v1.2.3-70-g09d2