From 6a8427c7c28bcf2ae06d4c523ef32059dd70d715 Mon Sep 17 00:00:00 2001 From: garret Date: Thu, 16 Feb 2023 02:45:32 +0000 Subject: dupe and comment: make undo handle comment status the same as do it no longer cares whether the edit is a comment or not. it now sets the original to whatever the edit was. better for doing stuff with comments etc --- macros/garret.dupe-and-comment.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'macros') diff --git a/macros/garret.dupe-and-comment.lua b/macros/garret.dupe-and-comment.lua index e89d774..8b00b75 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 = "4.0.0" +script_version = "5.0.0" script_namespace = "garret.dupe-and-comment" local haveDepCtrl, DependencyControl, depctrl = pcall(require, "l0.DependencyControl") @@ -64,8 +64,8 @@ local function undo(subs, sel, act) if not (sel[i] + 1 > #subs) then -- preventing out-of-range errors local original=subs[sel[i]+1] - if edit.comment == false and original.comment == true then - original.comment = false + if original.comment == true then + original.comment = edit.comment -- deal with being at the start/end of a fold local at_fold_end = find_fold_boundary(edit) -- cgit v1.2.3-70-g09d2