aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/editfns.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 0cbeefb3262..a1e48daf6c6 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2603,6 +2603,15 @@ It returns the number of characters changed. */)
2603 *p++ = *str++; 2603 *p++ = *str++;
2604 signal_after_change (pos, 1, 1); 2604 signal_after_change (pos, 1, 1);
2605 update_compositions (pos, pos + 1, CHECK_BORDER); 2605 update_compositions (pos, pos + 1, CHECK_BORDER);
2606
2607#ifdef HAVE_TREE_SITTER
2608 /* In the previous branch, replace_range() notifies
2609 changes to tree-sitter, but in this branch, we
2610 modified buffer content manually, so we need to
2611 notify tree-sitter manually. */
2612 treesit_record_change (pos_byte, pos_byte + len,
2613 pos_byte + len);
2614#endif
2606 } 2615 }
2607 characters_changed++; 2616 characters_changed++;
2608 } 2617 }
@@ -4776,6 +4785,13 @@ ring. */)
4776 adjust_markers_bytepos (start1, start1_byte, end2, end2_byte, 0); 4785 adjust_markers_bytepos (start1, start1_byte, end2, end2_byte, 0);
4777 } 4786 }
4778 4787
4788#ifdef HAVE_TREE_SITTER
4789 /* I don't think it's common to transpose two far-apart regions, so
4790 amalgamating the edit into one should be fine. This is what the
4791 signal_after_change below does, too. */
4792 treesit_record_change (start1_byte, end2_byte, end2_byte);
4793#endif
4794
4779 signal_after_change (start1, end2 - start1, end2 - start1); 4795 signal_after_change (start1, end2 - start1, end2 - start1);
4780 return Qnil; 4796 return Qnil;
4781} 4797}