Skip to main content

Heavy TOC flickering if expanded

Comments

3 comments

  • Kevin C

    It seems like the TOC in the sidebar is occasionally getting redrawn with every keystroke/edit regardless of the collapsed/expanded option. It doesn't do this consistently, however, even within the same editing session.

    Would it be helpful if instead of either collapsing everything or expanding everything on changes, it retained the actual collapsed state of each heading? When editing long documents, it would be nice to be able to only keep certain parts of the TOC tree expanded have have other portions collapsed.

    0
  • Fletcher Penney

    The challenge with the TOC is to reliably track which TOC entry correlates with which characters in the main text while the user is actively editing the text.

    I have some ideas about how to improve the ability to do this even when a large chunk of text is inserted in the middle of the document, shifting all subsequent headers by n characters, for example. 

    There is not a clean way to remember the collapse state on a per item basis, *unless* there is a way to persist which item is which between re-parses.  My goal was persistent collapse states, but without persistence of the actual header information, that can't be done.  But if I can get that working properly, then persistent collapse state is trivial.

    0
  • Kevin C

    Thanks for clarifying the situation! That makes sense.

    With regard to tracking TOC/outline positions in the text when inserting large chunks of text, your implementation actually seems to be super efficient. 

    I'm currently workin on about 650 line document with over 50 headings at four different levels. The last 15 or so headings are just titles with sub-headings and blank sub-content. Many of the actual paragarph content lines are a few hundred words long.

    I tried inserting a complete copy of the document at random locations in the same document, and the TOC view was able to update itself correctly and select the correct heading based on cursor/caret location almost instantly.

    The only issues with the TOC while editing text is actually the topic of this thread: that some times the TOC flickers or moves around while typing when it's expanded. If I edit a line with heading sometimes it seems to update with every keystroke.

    Would it work to just delay updating the TOC until the user stopped typing? 

    0

Please sign in to leave a comment.

Powered by Zendesk