Instead of removal of trailing blanks and tabs, the script adds empty lines repeatedly after the first one. Only stoppable by close of window, strange behaviour by NP++ after then.
def form(cont, lino, linum) :
"""
for all lines :
delete all leading blanks and tabs
"""
console.write('\n[%s], %d, %d' % (cont[:-1], lino, linum))
editor.replaceLine(lino, cont[:-1].lstrip(" \t"))
return 1
editor.forEachLine(form)
PythonScript 1.0.5.0 & NP++ v6.6.6 used
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Instead of removal of trailing blanks and tabs, the script adds empty lines repeatedly after the first one. Only stoppable by close of window, strange behaviour by NP++ after then.
def form(cont, lino, linum) :
"""
for all lines :
delete all leading blanks and tabs
"""
console.write('\n[%s], %d, %d' % (cont[:-1], lino, linum))
editor.replaceLine(lino, cont[:-1].lstrip(" \t"))
return 1
editor.forEachLine(form)
PythonScript 1.0.5.0 & NP++ v6.6.6 used
2nd attempt works today :-)
Instead of
editor.replaceLine(lino, cont[:-1].lstrip(" \t"))
I used
editor.replaceWholeLine(lino, cont.lstrip(" \t"))
Guess recursion comes from, that the script failed to position to the next line.