In need of a function

Post Reply
Jiminy Cricket
Posts: 2
Joined: Wed Aug 31, 2011 1:33 am

In need of a function

Post by Jiminy Cricket »

Disclaimer: This is not a first-resort hoping someone will just write it for me. I've tried a number of things, have had no success whatsover and finally decided to give up and ask here.

That out of the way, what I need is a function similar to (for better reference) Mushclient's 'DeleteLines(#)'. So, a function that would let me select a number of lines (two is perfect, doesn't need to be variable) to delete and allow for whatever replace I need.

Hope it's descriptive enough, and that it can be helped. Thanks in advance to anyone who gives it a shot!


P.S. I am fully prepared for having missed something very simple, or found in the manual somewhere. If this is the case, I apologise and ask that you point me to what it was I overlooked >.>

User avatar
Vadi
Posts: 5041
Joined: Sat Mar 14, 2009 3:13 pm

Re: In need of a function

Post by Vadi »

It's easy to forward-delete lines with:

deleteLine()
tempLineTrigger(1,1,[[deleteLine()]])

Back-delete not so, because deleteLine() doesn't support any parameters yet, unlike it was planned.

Jiminy Cricket
Posts: 2
Joined: Wed Aug 31, 2011 1:33 am

Re: In need of a function

Post by Jiminy Cricket »

Ahh, I see. Gotcha. I guess I can work with that.

Thanks for the reply!

Iocun
Posts: 174
Joined: Wed Dec 02, 2009 1:45 am

Re: In need of a function

Post by Iocun »

For deleting lines previous to the current one, you can use moveCursor() though:
Code: [show] | [select all] lua
moveCursor(0,getLineCount()-1)
deleteLine()
moveCursor(0,getLineCount())
deleteLine()
The above would delete the previous and the current line, for instance.

Post Reply