Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Honorary] Make disabling honos smarter (0.2.0) #52

Merged
merged 1 commit into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions DependencyControl.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,20 +212,21 @@
"description": "Rightfully restore (or remove) honoraries easily by inserting autoswapper bits",
"channels": {
"stable": {
"version": "0.1.0",
"released": "2024-08-26",
"version": "0.2.0",
"released": "2024-09-01",
"default": true,
"files": [
{
"name": ".moon",
"url": "@{fileBaseUrl}@{fileName}",
"sha1": "373625e67f8d0d87ff606856afb5fa1ce646dd3b"
"sha1": "83e703f427f4736bb98e2c5222dcfe4c83e57f53"
}
]
}
},
"changelog": {
"0.1.0": ["Add DependencyControl"]
"0.1.0": ["Add DependencyControl"],
"0.2.0": ["Make disabling honos smarter"]
}
},
"petzku.JumpToNextPlus": {
Expand Down
12 changes: 6 additions & 6 deletions macros/petzku.Honorary.moon
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export script_name = "Honorary"
export script_description = "Rightfully restore (or remove) honoraries easily by inserting autoswapper bits"
export script_author = "petzku"
export script_namespace = "petzku.Honorary"
export script_version = "0.1.0"
export script_version = "0.2.0"


_add_swap = (line, idx) ->
Expand All @@ -20,18 +20,18 @@ _enable = (line) ->
sel = line.text\sub ss, se-1
den = line.text\sub se
line.text = "#{beg}{*}#{sel}{*}#{den}"
-- at second {*_}
aegisub.gui.set_cursor #beg + #sel + 5
-- at second: mary{*}-tan{*_}
aegisub.gui.set_cursor #beg + #sel + 6
line

_disable = (line) ->
ss, se = aegisub.gui.get_selection!
beg = line.text\sub 1, ss-1
sel = line.text\sub ss, se-1
den = line.text\sub se
line.text = "#{beg}{**#{sel}}#{den}"
-- before swap: beg_{**sel}
aegisub.gui.set_cursor #beg
line.text = "#{beg}{*}{*#{sel}}#{den}"
-- at first: mary{*}_{*-tan}
aegisub.gui.set_cursor #beg + 4
line


Expand Down
Loading