diff options
Diffstat (limited to 'macros/garret.dupe-and-comment.lua')
-rw-r--r-- | macros/garret.dupe-and-comment.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/macros/garret.dupe-and-comment.lua b/macros/garret.dupe-and-comment.lua index 198a905..19f97a0 100644 --- a/macros/garret.dupe-and-comment.lua +++ b/macros/garret.dupe-and-comment.lua @@ -1,7 +1,7 @@ script_name="Dupe and Comment" script_description="Copies a line and comments out the original.\nbecause i like seeing the original while editing, and being able to go back to it easily" script_author = "garret" -script_version = "3.0.1" +script_version = "3.0.2" script_namespace = "garret.dupe-and-comment" local haveDepCtrl, DependencyControl, depctrl = pcall(require, "l0.DependencyControl") @@ -13,11 +13,12 @@ end local function comment(subs, sel, act) for i=#sel,1,-1 do - local line=subs[sel[i]] -- grab copy of current line + local edit=subs[sel[i]] -- current line + local original=subs[sel[i]] -- and a copy of it -- now use that copy for a different line - line.comment = true -- comment out the new dupe line - subs.insert(sel[i]+1, line) -- and put it below + original.comment = true -- comment out the new dupe line + subs.insert(sel[i]+1, original) -- and put it below -- if #sel > 1 then -- sort out sel/act |