jupyterlab-toc icon indicating copy to clipboard operation
jupyterlab-toc copied to clipboard

Cell edit mode with TOC

Open kenjioman opened this issue 7 years ago • 4 comments

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 #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!

kenjioman avatar Sep 21 '18 00:09 kenjioman

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 avatar Sep 28 '18 16:09 ian-r-rose

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?

ian-r-rose avatar Sep 28 '18 18:09 ian-r-rose

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

kenjioman avatar Oct 01 '18 17:10 kenjioman

Fixed for good in #71, I think.

ian-r-rose avatar Jan 09 '19 03:01 ian-r-rose