Page 1 of 1

LinesUnwrap?

Posted: Tue Feb 24, 2026 7:42 am
by Hanging
In newer versions, I don't find the old LinesUnwrap script. I would like to have that capability, e.g. to take the following...

My line
that is wrapped
with newlines

...select it, and have it automatically take out the newlines so that it becomes...

My line that is wrapped with newlines

...and it seems that the old LinesUnwrap could do this. Where is this capability in Akelpad now?

By the way, thanks very much for updating Akelpad for Windows 11. I was getting worried that we would fall too far behind. Now I only wish there were an Akelpad for Linux, as Windows 11 is so awful that I will never have another Windows computer after this. When Microsoft forces users to "upgrade" to Windows 12, I'll be jumping ship. I'm already learning Linux Mint which I installed on my old Windows 10 laptop. About the only program I miss is Akelpad!

Re: LinesUnwrap?

Posted: Mon Mar 02, 2026 2:36 pm
by ewild
Hanging,
Feel free to try something as simple as this:
RemoveNewLines.js

Code: Select all

// RemoveNewLines.js
// 2026-03-02 by ewild
// Usage:
// "Remove NewLines" Call("Scripts::Main",1,"RemoveNewLines.js")

// get selection
start=AkelPad.GetSelStart();// initial selection start offset
end=AkelPad.GetSelEnd();// initial selection end offset

// if there's no selection, select the entire text
if (start == end)
AkelPad.SetSel(0,-1);

text=AkelPad.GetSelText();// select action

text=text.replace(/[\s]*\r+[\s]*/gm," ");// replace new lines (and the adjacent whitespaces, if any) with a single whitespace
text=text.replace(/^\s*|\s*$/g,"");// replace leading and trailing whitespaces and new lines (if any) with nothing

AkelPad.ReplaceSel(text); // replace action

AkelPad.SetSel(start,start);// restore initial cursor position

Re: LinesUnwrap?

Posted: Tue Mar 03, 2026 12:04 am
by Instructor