As reported in this BA thread
There's one attribute missing to be able to perform actions relative to a multiline selection.
Here is the attibute list :
current_character # character position (at selection character start) current_line # line object where cursor is (at selection start) current_line_index # index where cursor is (at selection start) select_end_character # character position at selection end select_end_line # line object where selection end (but no index accessible) !! MISSING !! >> select_end_line_index (impossible to know where the selection end)
Maybe I missed a way to get the selection directly ? (so we can count the '\n' as a workaround without using 'bpy.ops.text.copy()' that overwrite clipboard)
PS : I did not know who to assign so I chose you Jacques since you wrote code-autocomplete and should be familliar with text editor, I'm sorry if you're not the right guy to bother.