VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
14.01k stars 1.32k forks source link

Handle unicode surrogate pairs in `DeleteOperator` #9220

Closed semicube closed 3 months ago

semicube commented 3 months ago

What this PR does / why we need it:

Checks if the start and end character in DeleteOperator is a low surrogate. If it is, then we extend them by using .getLeft() and .getRight() respectively. Here's a comparison (when doing 'x' & 'p' in normal mode):

Behavior before:

before

After this PR:

after

Which issue(s) this PR fixes

3070 (step 4 in the issue)

Special notes for your reviewer:

This is already done in YankOperator, I've just added the same check to DeleteOperator