LDCad My second LDCad script :)

RE: My second LDCad script :)
I've updated my buffer exchange cleanup script; it is now a true toggle function. I've added a tag "BufEx:" to any lines that are commented out by the script, so that it will also uncomment any such lines with that tag, while leaving other comments alone.

At the same time, I've added another toggle macro to comment out or uncomment any line. Actually, this is just Roland's togglePrefix() function that comes with the MLCad script, except with a slight modification so that it will correctly remove both "0 //" and "0 // " (with an extra space). It will always write the extra space, however.

There's probably a way I could have structured the whole thing differently and used the same method for both toggle functions, since they're essential identical. But maybe not, since one works on the whole subfile, while the other only works on a selection.

There is one problem, but I'm not sure if the issue is with the script or with the way LDCad handles the source window: it doesn't seem to work on actual comments! If I try to uncomment an existing, all-text comment (i.e., not a type 1-5 lines or a type 0 meta), it's replaced with an empty line. If I toggle again, it comments out the empty line.

Anyway, here's the updated script:
.lua   togBufEx.lua (Size: 2.81 KB / Downloads: 2)
« Next Oldest | Next Newest »

Messages In This Thread
My second LDCad script :) - by N. W. Perry - 2022-12-28, 14:43
RE: My second LDCad script :) - by N. W. Perry - 2023-01-18, 18:56

Forum Jump:

Users browsing this thread: 1 Guest(s)