mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-08 13:19:36 +00:00
Add missing calls to treesit_record_change in editfns.c
These should be all that are missing. See the next commit for detail. * src/editfns.c (Ftranslate_region_internal): (Ftranspose_regions): Call treesit_record_change.
This commit is contained in:
parent
e982192e93
commit
02b6be892f
1 changed files with 16 additions and 0 deletions
|
@ -2603,6 +2603,15 @@ It returns the number of characters changed. */)
|
||||||
*p++ = *str++;
|
*p++ = *str++;
|
||||||
signal_after_change (pos, 1, 1);
|
signal_after_change (pos, 1, 1);
|
||||||
update_compositions (pos, pos + 1, CHECK_BORDER);
|
update_compositions (pos, pos + 1, CHECK_BORDER);
|
||||||
|
|
||||||
|
#ifdef HAVE_TREE_SITTER
|
||||||
|
/* In the previous branch, replace_range() notifies
|
||||||
|
changes to tree-sitter, but in this branch, we
|
||||||
|
modified buffer content manually, so we need to
|
||||||
|
notify tree-sitter manually. */
|
||||||
|
treesit_record_change (pos_byte, pos_byte + len,
|
||||||
|
pos_byte + len);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
characters_changed++;
|
characters_changed++;
|
||||||
}
|
}
|
||||||
|
@ -4776,6 +4785,13 @@ ring. */)
|
||||||
adjust_markers_bytepos (start1, start1_byte, end2, end2_byte, 0);
|
adjust_markers_bytepos (start1, start1_byte, end2, end2_byte, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_TREE_SITTER
|
||||||
|
/* I don't think it's common to transpose two far-apart regions, so
|
||||||
|
amalgamating the edit into one should be fine. This is what the
|
||||||
|
signal_after_change below does, too. */
|
||||||
|
treesit_record_change (start1_byte, end2_byte, end2_byte);
|
||||||
|
#endif
|
||||||
|
|
||||||
signal_after_change (start1, end2 - start1, end2 - start1);
|
signal_after_change (start1, end2 - start1, end2 - start1);
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue