Giter Site home page Giter Site logo

Comments (5)

joaotavora avatar joaotavora commented on June 28, 2024

Reproduced. Maybe I could do something about this, but you should first ask svelte-modes developers why the imenu structure
they they produce in your example is (("" . 20)), i.e. why are there menu elements with empty strings.

I.e. if I do something about this, it will not change the outcome dramatically: the error will disappear but there will be nonsensical imenu information

from breadcrumb.

leafOfTree avatar leafOfTree commented on June 28, 2024

Hi, I'm from svelte-mode and not quite sure about the imenu structure. svelte-mode is based on mhtml-mode.
Both have the same issue.

It seems that the menu is using <h1> tag text content. The error occurs when it's empty. Otherwise, it will show its content.

    <section>
      <h1>
        hello
        <span class="welcome">
        </span>
      </h1>
      <Counter />
    </section>

For this case, I think we can ignore the error as HTML tags may have empty text content and result in an empty menu.

from breadcrumb.

joaotavora avatar joaotavora commented on June 28, 2024

For this case, I think we can ignore the error as HTML tags may have empty text content and result in an empty menu.

Sure, I guess. Breadcrumb operates on the same information that M-x imenu does. Major mode authors setting up imenu-create-index-function or authors deriving from such modes such always test that M-x imenu does reasonable things.

If it doesn't, neither will breadcrumb. Imenu is a flimsy and hacked-together piece of utility, unfortunately, but it's the most widespread one.

If the problem lies deeper in mhtml-mode ,then it should probably be fixed there.

from breadcrumb.

leafOfTree avatar leafOfTree commented on June 28, 2024

I agree the major mode (actually it's sgml-mode ) should provide correct and useful imenu info. But I'm not sure where to find the sgml-mode maintainer.

By the way, it seems to stop working if there is an incorrect imenu. The breadcrumb bar becomes empty with: Error during redisplay: (eval (breadcrumb--header-line) t) signaled (args-out-of-range 0 1)

Screenshot 2024-05-14 at 19 23 33

Is it possible that, on the other side, breadcrumb can handle the error gracefully, like just ignoring the error?

from breadcrumb.

joaotavora avatar joaotavora commented on June 28, 2024

But I'm not sure where to find the sgml-mode maintainer.

Isn't it a part of Emacs? Report it to [email protected].

Is it possible that, on the other side, breadcrumb can handle the error gracefully, like just ignoring the error?

Yes, as I said something like that can be done. But making breadcrumb.el ignoring this particular error is somewhat tricky, so if someone has patch and can test through some edge cases (like an imenu that does have some invalid entries and some valid ones), it would be ideal.

from breadcrumb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.