aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYuan Fu2023-06-28 17:03:19 -0700
committerYuan Fu2023-06-29 11:15:29 -0700
commit02b6be892fa1a30b42c3df21319dddd2f445175e (patch)
treecb8886d150619f5490d7d07f1b2cb1ddaa195b1f /src
parente982192e93369265cca7827065e13bf1f71aad13 (diff)
downloademacs-02b6be892fa1a30b42c3df21319dddd2f445175e.tar.gz
emacs-02b6be892fa1a30b42c3df21319dddd2f445175e.zip
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.
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}