Subject: bug#78456: 31.0.50; regression in treesit-simple-imenu

From: Vincenzo Pupillo <[email-masked]>
Date: Fri, 16 May 2025 16:03:32 +0200

Ciao, 
Imenu of ‘mhtml-ts-mode’ was able to show all (when I wrote mhtml-ts-mode) 
items regardless of the cursor's position within the file. 
For example, it always showed CSS, JavaScript, and HTML items. However, I 
realized that the behavior has changed, and the displayed items vary depending 
on the cursor's position.

If the cursor is placed inside the <script> tags, you will see HTML and 
JavaScript items, but not CSS items. If the cursor is positioned outside the 
<style> and <script> tags, only the HTML items are visible.

This change seems to be related to the patch (bug #77256). Is it possible to 
restore the previous behavior?

Thanks.
V.

--8<---------------cut here---------------start------------->8---
<!DOCTYPE html>
<html>
  <head>
    <title></title>
    <style>
      body {
	  background-color: lightblue;
      }

      h1 {
	  color: white;
	  text-align: center;
      }

      p {
	  font-family: verdana;
	  font-size: 20px;
      }

      c {
	  color: red;
      }
    </style>
    <script>
      function myFunction(p1, p2) {
	  return p1 * p2;
      }

      function test(a, b) {
	  return a + b;
      }

      function provola(c, d, e) {
	  return c + d + e;
      }
    </script>
    <script>
      function tion(p1, p2) {
	  return p1 * p2;
      }

    </script>
  </head>
  <body>
    <h1>
      <div></div>
      <a href="http://example.com">http://example.com</a>
      <div></div>
      <div></div>
    </h1>
  </body>
</html>
--8<---------------cut here---------------end--------------->8---