Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Cell edit mode with TOC #51

Open
kenjioman opened this issue Sep 21, 2018 · 4 comments
Open

Cell edit mode with TOC #51

kenjioman opened this issue Sep 21, 2018 · 4 comments

Comments

@kenjioman
Copy link

I just noticed -- if you have an active cursor in a cell (in edit mode) when you click on a TOC entry:

  1. If it refers to a markdown cell, it jumps to the cell and makes the cell in edit mode as well.
  2. If the TOC entry is from a generated markdown header (as implemented in Capture Headings from Generated Markdown #15), it jumps to the code block that generated it, and not the place in the notebook with the header.

In case 1, I expect my active cursor to stay in the cell I was at (and just jump my view in the notebook to the markdown cell in question), or leave the active cell (no longer be in edit mode).

In case 2, I expect to jump to the specific place in the notebook with the generated markdown header being displayed, not the place in the code that generated it (if I have a long list of figures being made, delineated by markdown headers, I'd like to be able to just jump to my figure in question, not the top code block), with the same behavior for the cursor as case 1.

Thanks again for all the active development, and for the great plugin! I use it daily, and it is a real lifesaver!

echarles pushed a commit to datalayer-externals/jupyterlab-toc that referenced this issue Sep 25, 2018
@ian-r-rose
Copy link
Member

Thanks for the report @kenjioman! There have been a few regressions after #34, and at least your second point seems like one of those. The fix there should be straightforward.

Just so I understand your first point: is the issue that the cursor is disappearing when you click the heading?

Glad you are enjoying the extension!

@ian-r-rose
Copy link
Member

Ah, I think I understand your first point a bit better. The current behavior is that it moves the cursor to the location of the header. That made a bit more sense when there could be many ToC headers in a markdown cell (cf. #34 and #54), but now it just has the effect of moving the cursor to the first line. I think it would make sense for us to not move the cursor in light of that change.

What do you think?

@kenjioman
Copy link
Author

Yes, I am in favor of not moving the cursor as well. Thanks for the continued progress!

@ian-r-rose
Copy link
Member

Fixed for good in #71, I think.

@ian-r-rose ian-r-rose reopened this Jan 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants