Fix BCodeEdit

Fix text insertion.

Fix text deletion in blocks mode.

Fix text replacing in blocks mode.