You can also try this macro, tested under Win10 Libre7.5.3.2, I hope it will be functional also under Linux.
It replaces Enter+Tab → Tab, from end position of visible cursor to the end of document. There is only one step in Undo Manager for all replacements (try menu: Edit/Undo).
Sub replaceEnterTab 'replace Enter+Tab only to Tab, from end of visible cursor to the end of document
on local error goto bug
dim oDoc as object, oDesc as object, oFound as object, oVCur as object, sEnter$, undoMgr as object, bUndo as boolean
const sUndo="Replace Enter+Tab"
oDoc=ThisComponent
oVCur=oDoc.CurrentController.ViewCursor 'visible cursor
oVCur.collapseToEnd
rem detect used Enter according to OS
select case getGuiType
case 3 'mac
sEnter=chr(13)
case 4 'linux
sEnter=chr(10)
case 1 'win
sEnter=chr(13) & chr(10)
case else 'some "ufo", so for example try linux
sEnter=chr(10)
end select
rem searching
oDesc=oDoc.createSearchDescriptor
with oDesc
.SearchRegularExpression=true
.SearchString="$" 'find Enter
end with
oFound=oDoc.findNext(oVCur.End, oDesc) 'find 1st Enter after visible cursor
do while NOT IsNull(oFound) 'Enter found
oVCur.goToRange(oFound.Start, false) 'cursor before Enter
oVCur.goRight(2, true) 'read Enter and next character
if oVCur.string=sEnter & chr(9) then 'read characters are Enter+Tab
if bUndo=false then '1st finding, so activate UndoManager
bUndo=true
undoMgr=oDoc.UndoManager
undoMgr.enterUndoContext(sUndo) 'activate UndoManager
oDoc.lockControllers 'no screen rendering (it is faster)
end if
oVCur.String=chr(9) 'replace for Tab
oVCur.goRight(0, false) 'collapse cursor to the end
end if
oFound=oDoc.findNext(oVCur.End, oDesc) 'find next Enter
loop
if bUndo then 'there was some finding
undoMgr.leaveUndoContext(sUndo) 'deactivate UndoManager
oDoc.unlockControllers 'allow screen rendering
end if
exit sub
bug:
if oDoc.hasControllersLocked then oDoc.unlockControllers
msgbox("line: " & Erl & chr(13) & Err & ": " & Error, 16, "Bug")
End Sub
:-), AIs must have a lot of examples to build some result, and there is a very few macros on internet how to find Enter+character via LibreBasic macro :-). And for AI’s providers is problematic to say: “I don’t know, too little quantity of input data to build some more-probable-than-shiny-lies result”; or experienced version: “I don’t know, although overly quantity of data and it is just good for nothing anyway.”