GNU bug report logs -
#70789
treesit navigate for outlines at bobp
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Sun, 5 May 2024 16:57:01 UTC
Severity: normal
Fixed in version 30.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
>> 'treesit-outline-search' didn't match outlines at the beginning of
>> the buffer because unlike 're-search-forward' (used by outline-mode)
>> that matches the text that immediately follows point,
>> 'treesit-navigate-thing' misses text at point and stars the search
>> after point.
>>
>> So there is a need to handle this difference specially. Therefore this
>> patch adds such special-handling of bobp to 'treesit-outline-search’:
>
> Thanks. Just for me to understand it better, could you show an
> example where treesit-navigate-thing misses text at point?
Here is an example:
0. emacs -Q
1. C-x C-f test/lisp/progmodes/ruby-mode-resources/ruby-method-params-indent.rb
2. M-x ruby-ts-mode
3. M-: (setq outline-minor-mode-use-buttons t)
4. M-x outline-minor-mode
There are no outline buttons because the top thing "class"
is at the beginning of the buffer. Then you can insert
an empty line before "class", and disable/enable
outline-minor-mode again, and outline buttons appear
on "class" and "def" lines.
Basically this is because
(treesit-navigate-thing (point-min) 1 'beg "\\`\\(?:class\\|method\\)\\'")
can't find "class" at the beginning of the buffer,
but after inserting an empty line before "class" it can find it.
> If it does, that should be a bug that treesit-navigate-thing should
> fix, right?
I'm not sure if this is a bug. Maybe it can be described just as
a difference between re-search-forward and treesit-navigate-thing.
This bug report was last modified 1 year and 12 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.