aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index a408b799ff4..53aa3163fe0 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -48,6 +48,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
48#include "w32heap.h" /* for mmap_* */ 48#include "w32heap.h" /* for mmap_* */
49#endif 49#endif
50 50
51#ifdef HAVE_TREE_SITTER
52#include "treesit.h"
53#endif
54
51/* Work around GCC bug 109847 55/* Work around GCC bug 109847
52 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109847 56 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109847
53 which causes GCC to mistakenly complain about 57 which causes GCC to mistakenly complain about
@@ -641,6 +645,13 @@ even if it is dead. The return value is never nil. */)
641 bset_width_table (b, Qnil); 645 bset_width_table (b, Qnil);
642 b->prevent_redisplay_optimizations_p = 1; 646 b->prevent_redisplay_optimizations_p = 1;
643 647
648#ifdef HAVE_TREE_SITTER
649 /* By default, use empty linecol, which means disable tracking. */
650 SET_BUF_TS_LINECOL_BEGV (b, TREESIT_EMPTY_LINECOL);
651 SET_BUF_TS_LINECOL_POINT (b, TREESIT_EMPTY_LINECOL);
652 SET_BUF_TS_LINECOL_ZV (b, TREESIT_EMPTY_LINECOL);
653#endif
654
644 /* An ordinary buffer normally doesn't need markers 655 /* An ordinary buffer normally doesn't need markers
645 to handle BEGV and ZV. */ 656 to handle BEGV and ZV. */
646 bset_pt_marker (b, Qnil); 657 bset_pt_marker (b, Qnil);
@@ -867,6 +878,13 @@ Interactively, CLONE and INHIBIT-BUFFER-HOOKS are nil. */)
867 b->bidi_paragraph_cache = 0; 878 b->bidi_paragraph_cache = 0;
868 bset_width_table (b, Qnil); 879 bset_width_table (b, Qnil);
869 880
881#ifdef HAVE_TREE_SITTER
882 /* By default, use empty linecol, which means disable tracking. */
883 SET_BUF_TS_LINECOL_BEGV (b, TREESIT_EMPTY_LINECOL);
884 SET_BUF_TS_LINECOL_POINT (b, TREESIT_EMPTY_LINECOL);
885 SET_BUF_TS_LINECOL_ZV (b, TREESIT_EMPTY_LINECOL);
886#endif
887
870 name = Fcopy_sequence (name); 888 name = Fcopy_sequence (name);
871 set_string_intervals (name, NULL); 889 set_string_intervals (name, NULL);
872 bset_name (b, name); 890 bset_name (b, name);
@@ -2618,6 +2636,13 @@ results, see Info node `(elisp)Swapping Text'. */)
2618 bset_point_before_scroll (current_buffer, Qnil); 2636 bset_point_before_scroll (current_buffer, Qnil);
2619 bset_point_before_scroll (other_buffer, Qnil); 2637 bset_point_before_scroll (other_buffer, Qnil);
2620 2638
2639#ifdef HAVE_TREE_SITTER
2640 swapfield_ (ts_parser_list, Lisp_Object);
2641 swapfield (ts_linecol_begv, struct ts_linecol);
2642 swapfield (ts_linecol_point, struct ts_linecol);
2643 swapfield (ts_linecol_zv, struct ts_linecol);
2644#endif
2645
2621 modiff_incr (&current_buffer->text->modiff, 1); 2646 modiff_incr (&current_buffer->text->modiff, 1);
2622 modiff_incr (&other_buffer->text->modiff, 1); 2647 modiff_incr (&other_buffer->text->modiff, 1);
2623 modiff_incr (&current_buffer->text->chars_modiff, 1); 2648 modiff_incr (&current_buffer->text->chars_modiff, 1);