diff options
author | garret <garret@airmail.cc> | 2023-01-21 02:33:35 +0000 |
---|---|---|
committer | garret <garret@airmail.cc> | 2023-01-21 02:35:04 +0000 |
commit | 8451de1b2e4631ff29f1d48ae34367ea0ac4a3eb (patch) | |
tree | af8a22b2ccbd3c11822bb02375f04d1c563613dd /macros/em-dash.lua | |
parent | 2a6b5d36854b0e811529f0954453ea72052e4e15 (diff) | |
download | aegisub-scripts-8451de1b2e4631ff29f1d48ae34367ea0ac4a3eb.tar.gz aegisub-scripts-8451de1b2e4631ff29f1d48ae34367ea0ac4a3eb.tar.bz2 aegisub-scripts-8451de1b2e4631ff29f1d48ae34367ea0ac4a3eb.zip |
em-dash: minor fixes on replace function
fix inconsistent indentation with the rest of the script, and itself
made it a local function
Diffstat (limited to 'macros/em-dash.lua')
-rw-r--r-- | macros/em-dash.lua | 18 |
1 files changed, 9 insertions, 9 deletions
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 |