Add set nofixeol option command. Without it, these editors will return content with a line feed character at the end of text, when it was sent without one. Content sent with a final LF will be unaffected.
Change cursor() which works on bytes, to setcursorcharpos() which is equivalent but works correctly on multi-byte characters. Verify with the string 🌲🌲🌲⛳ in a textarea and the cursor on the green. The former function will put you in the woods.
Add
set nofixeol
option command. Without it, these editors will return content with a line feed character at the end of text, when it was sent without one. Content sent with a final LF will be unaffected.Change
cursor()
which works on bytes, tosetcursorcharpos()
which is equivalent but works correctly on multi-byte characters. Verify with the string🌲🌲🌲⛳
in a textarea and the cursor on the green. The former function will put you in the woods.