diff options
| author | Eli Zaretskii | 2023-12-16 09:17:51 -0500 |
|---|---|---|
| committer | Eli Zaretskii | 2023-12-16 09:17:51 -0500 |
| commit | a1d3862c6240805bde997bb57f60fceb0fbccb85 (patch) | |
| tree | 3f0a8b9a8b7bd132336945aaad085afb185baffd /src | |
| parent | 47b10d062df643da6ecc6fc3b6b1cbb668eebb39 (diff) | |
| parent | bf4ccb0be076d8b65498c56dedf0eee17cb3c24c (diff) | |
| download | emacs-a1d3862c6240805bde997bb57f60fceb0fbccb85.tar.gz emacs-a1d3862c6240805bde997bb57f60fceb0fbccb85.zip | |
Merge from origin/emacs-29
bf4ccb0be07 ; * lisp/term.el (term--xterm-paste): Fix last change.
0d9e2e448d9 ; * doc/lispref/functions.texi (Function Documentation): ...
791cc5065da Fix shaping of Sinhala text
efcbf0b5abf Add use cases of (fn) documentation facility.
c3331cb3659 Fix pasting into terminal-mode on term.el
5be94e2bce5 Fix opening directory trees from Filesets menu
6b6e770a1f5 Eglot: Add ruff-lsp as an alternative Python server
ed8a8a5ba16 Fix symbol name in Multisession Variables examples
400ef15bdc3 js-ts-mode: Fix font-lock rules conflict
c165247c300 Add indentation rules for bracketless statements in js-ts...
7f1bd69cd19 Fix c-ts-mode bracketless indentation for BSD style (bug#...
e23068cb9a1 Add missing indent rules in c-ts-mode (bug#66152)
d2c4b926ac2 Fix treesit-default-defun-skipper (bug#66711)
9874561f39e Fix treesit-node-field-name and friends (bug#66674)
eace9e11226 python-ts-mode: Highlight default parameters
23c06c7c308 Update to Org 9.6.13
Diffstat (limited to 'src')
| -rw-r--r-- | src/treesit.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/treesit.c b/src/treesit.c index b8de95ec691..c85038e70cf 100644 --- a/src/treesit.c +++ b/src/treesit.c | |||
| @@ -2063,9 +2063,8 @@ DEFUN ("treesit-node-field-name-for-child", | |||
| 2063 | Return nil if there's no Nth child, or if it has no field. | 2063 | Return nil if there's no Nth child, or if it has no field. |
| 2064 | If NODE is nil, return nil. | 2064 | If NODE is nil, return nil. |
| 2065 | 2065 | ||
| 2066 | N counts all children, i.e., named ones and anonymous ones. | 2066 | Note that N counts named nodes only. Also, N could be negative, e.g., |
| 2067 | 2067 | -1 represents the last child. */) | |
| 2068 | N could be negative, e.g., -1 represents the last child. */) | ||
| 2069 | (Lisp_Object node, Lisp_Object n) | 2068 | (Lisp_Object node, Lisp_Object n) |
| 2070 | { | 2069 | { |
| 2071 | if (NILP (node)) | 2070 | if (NILP (node)) |
| @@ -2079,7 +2078,7 @@ N could be negative, e.g., -1 represents the last child. */) | |||
| 2079 | 2078 | ||
| 2080 | /* Process negative index. */ | 2079 | /* Process negative index. */ |
| 2081 | if (idx < 0) | 2080 | if (idx < 0) |
| 2082 | idx = ts_node_child_count (treesit_node) + idx; | 2081 | idx = ts_node_named_child_count (treesit_node) + idx; |
| 2083 | if (idx < 0) | 2082 | if (idx < 0) |
| 2084 | return Qnil; | 2083 | return Qnil; |
| 2085 | if (idx > UINT32_MAX) | 2084 | if (idx > UINT32_MAX) |