I want to get the selected text from a given widget. I know about the example dump_selection.py but there are at least 2 major bugs in that code and I have tried to fix it but reading that code is insane. How can there not be a simple ida_kernwin.get_selected_text()?
So the bugs:
First is that the dump_selection do not work if you select text on 1 line only (That one I think I got fixed)
The second bug is way worse… If you select text on 1 line that spans over some special characters (not sure which ones but usually selecting a functions name and arguments do the trick) the dump_selection.py returns an empty string.
Anyone got a fully functional select_text() function that I can use?
EDIT: My fix (which I don’t really call a fix since it only fixes the problem with text on 1 line) is that I check if the end and start are on the same line and if they are, then I use ida_kernwin.get_custom_viewer_curline() instead