Group bracket matching into single undo