Would it be possible to have that content remain selected after the script is applied?
Yes, but "restore" instead of "remain", see `geany.select()`: ```lua local start, stop = geany.select() local s = geany.selection() ... geany.selection(...) geany.select(start, stop) end ```
If can figure out why this does not apply to multiple lines
I can :) This is not provided, I don't know a suitable algorithm.