aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/change.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-08-30 12:58:48 +0200
committerGitHub <noreply@github.com>2024-08-30 12:58:48 +0200
commit5f95f1249f464e4f0ceed468ec5a1ba6e810da14 (patch)
tree6113193fda7a7c0f94577a464e39964e74311583 /src/nvim/change.c
parent4353996d0fa8e5872a334d68196d8088391960cf (diff)
parentcfdf68a7acde16597fbd896674af68c42361102c (diff)
downloadrneovim-5f95f1249f464e4f0ceed468ec5a1ba6e810da14.tar.gz
rneovim-5f95f1249f464e4f0ceed468ec5a1ba6e810da14.tar.bz2
rneovim-5f95f1249f464e4f0ceed468ec5a1ba6e810da14.zip
Merge pull request #30014 from bfredl/neoemoji
support emojis with ZWJ and variant selectors
Diffstat (limited to 'src/nvim/change.c')
-rw-r--r--src/nvim/change.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/change.c b/src/nvim/change.c
index 6e9fab5a9b..47a9f0ce92 100644
--- a/src/nvim/change.c
+++ b/src/nvim/change.c
@@ -896,14 +896,15 @@ int del_bytes(colnr_T count, bool fixpos_arg, bool use_delcombine)
// delete the last combining character.
if (p_deco && use_delcombine && utfc_ptr2len(oldp + col) >= count) {
char *p0 = oldp + col;
- if (utf_composinglike(p0, p0 + utf_ptr2len(p0))) {
+ GraphemeState state = GRAPHEME_STATE_INIT;
+ if (utf_composinglike(p0, p0 + utf_ptr2len(p0), &state)) {
// Find the last composing char, there can be several.
int n = col;
do {
col = n;
count = utf_ptr2len(oldp + n);
n += count;
- } while (utf_composinglike(oldp + col, oldp + n));
+ } while (utf_composinglike(oldp + col, oldp + n, &state));
fixpos = false;
}
}
@@ -1694,7 +1695,7 @@ bool open_line(int dir, int flags, int second_line_indent, bool *did_do_comment)
}
if (curbuf->b_p_ai || (flags & OPENLINE_DELSPACES)) {
while ((*p_extra == ' ' || *p_extra == '\t')
- && !utf_iscomposing(utf_ptr2char(p_extra + 1))) {
+ && !utf_iscomposing_first(utf_ptr2char(p_extra + 1))) {
if (REPLACE_NORMAL(State)) {
replace_push(*p_extra);
}