I had added a solution, but not was the ideal solution. The problem is that _delete_range is executed after the delete_selection then the subtask is deleted after the selection and the selection can't be totally deleted.
I had added a solution, but not was the ideal solution. The problem is that _delete_range is executed after the delete_selection then the subtask is deleted after the selection and the selection can't be totally deleted.