Unicode characters that exceed one byte are not treated correctly.
Minimal example
.vimrc
let g:AutoPairs = {"X": "Y", "《": "》"}
imap ABC 《
The characters "《" and "》" are Unicode U+300A and U+300B respectively. They can be typed natively in Vim by typing <C-k><LT>+ and <C-k>>+ respectively. Other multi-byte characters will also present the bug.
Reproduction steps
Open Vim
Open insert mode (i) and type X.
If auto-pairs and the .vimrc are loaded correctly, the line should read XY.
Press <BS> to remove both the X and Y, leaving an empty buffer.
Type <C-k><LT>+ (Control+k, less-than symbol, then plus symbol).
Expected behavior: The line should read 《》.
Actual behavior: The line reads 《. The pair doesn't pair.
Press <BS> to clear the buffer.
Type ABC.
Expected behavior: The line should read 《》
By mapping ABC to 《 and enabling recursive mapping, the 《 character should be typed, causing auto-pairs to complete the pair.
Actual behavior:ERROR:
E115: Missing single quote: 'ã
E116: Invalid arguments for function AutoPairsInsert('ã
Press ENTER or type command to continue
Tested on a fresh vim install in a newly-made Debian VM.
Unicode characters that exceed one byte are not treated correctly.
Minimal example
.vimrc
The characters "《" and "》" are Unicode U+300A and U+300B respectively. They can be typed natively in Vim by typing
<C-k><LT>+
and<C-k>>+
respectively. Other multi-byte characters will also present the bug.Reproduction steps
i
) and typeX
.auto-pairs
and the.vimrc
are loaded correctly, the line should readXY
.<BS>
to remove both theX
andY
, leaving an empty buffer.<C-k><LT>+
(Control+k, less-than symbol, then plus symbol).《》
.《
. The pair doesn't pair.<BS>
to clear the buffer.ABC
.《》
ABC
to《
and enabling recursive mapping, the《
character should be typed, causingauto-pairs
to complete the pair.Tested on a fresh vim install in a newly-made Debian VM.