From 0c146cd4304622373c9b10980a7d4149a9ed5208 Mon Sep 17 00:00:00 2001 From: garret Date: Thu, 16 Feb 2023 01:34:39 +0000 Subject: dupe and comment: make variable names more informative --- macros/garret.dupe-and-comment.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'macros/garret.dupe-and-comment.lua') 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 -- cgit v1.2.3-70-g09d2