Page 1 of 1

In need of a function

Posted: Wed Aug 31, 2011 1:48 am
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 >.>

Re: In need of a function

Posted: Wed Aug 31, 2011 3:47 am
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.

Re: In need of a function

Posted: Wed Aug 31, 2011 4:35 am
by Jiminy Cricket
Ahh, I see. Gotcha. I guess I can work with that.

Thanks for the reply!

Re: In need of a function

Posted: Wed Aug 31, 2011 9:17 pm
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.