all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#59630: 29.0.50; treesitter-buffer-root-node doesn't change when changing buffer restriction
@ 2022-11-27 12:49 miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-11-27 22:40 ` Yuan Fu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-11-27 12:49 UTC (permalink / raw)
  To: 59630

[-- Attachment #1: Type: text/plain, Size: 725 bytes --]

Treesitter doesn't seem to change its parse tree when changing
restriction. It gets it correct the first time when we query the root
node, but then, after changing restriction, it doesn't seem to get
updated.

The following is an M-x ielm session to demonstrate the problem

  ELISP> (set-buffer (get-buffer-create "test"))
  ELISP> (insert "echo '123'")
  ELISP> (narrow-to-region 1 4)
  ELISP> (buffer-string)
  "echo"
  ELISP> (treesit-buffer-root-node 'bash)
  #<treesit-node
  (program)
  in 1-4>  ;; This is expected

  ELISP> (widen)
  ELISP> (treesit-buffer-root-node 'bash)
  #<treesit-node
  (program)
  in 1-4>  ;; <---- This is not expected, the root node should span 1-9

  ELISP> (buffer-string)
  "echo '123'"

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-09 22:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-27 12:49 bug#59630: 29.0.50; treesitter-buffer-root-node doesn't change when changing buffer restriction miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-27 22:40 ` Yuan Fu
2022-11-28 12:09   ` Eli Zaretskii
2022-11-28 22:37 ` Yuan Fu
2022-12-09 22:13 ` Yuan Fu

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.