diff options
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r-- | src/nvim/diff.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c index 6309aa6c5e..ad3e093dde 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -2990,10 +2990,15 @@ static void diff_find_change_inline_diff(diff_T *dp) char *s = curline; while (*s != NUL) { - // Always use the first buffer's 'iskeyword' to have a consistent diff bool new_in_keyword = false; if (diff_flags & DIFF_INLINE_WORD) { - new_in_keyword = vim_iswordp_buf(s, curtab->tp_diffbuf[file1_idx]); + // Always use the first buffer's 'iskeyword' to have a + // consistent diff. + // For multibyte chars, only treat alphanumeric chars + // (class 2) as "word", as other classes such as emojis and + // CJK ideographs do not usually benefit from word diff as + // Vim doesn't have a good way to segment them. + new_in_keyword = (mb_get_class_tab(s, curtab->tp_diffbuf[file1_idx]->b_chartab) == 2); } if (in_keyword && !new_in_keyword) { ga_append(curstr, NL); |