Skip to content

Variety fixes#80

Open
pimotte wants to merge 9 commits intomappingfrom
feature/reenable-buttons
Open

Variety fixes#80
pimotte wants to merge 9 commits intomappingfrom
feature/reenable-buttons

Conversation

@pimotte
Copy link
Copy Markdown
Contributor

@pimotte pimotte commented Mar 12, 2026

Fixes the line numbers and parent selection from #71

Reenables the buttons as well.

To test:

  • Insert (code) cells in document and observe the line numbers be correct
  • Select parent node with ctrl+.

@pimotte pimotte requested a review from DikieDick March 12, 2026 14:00
@DikieDick
Copy link
Copy Markdown
Contributor

Insertion of math and text nodes still break the document and don't update the line numbers. Is this acceptable for re-enabling the menubuttons?

The fix for making sure that the text and math node insertions don't break the document is to include a check in insertAbove (similarly in insertBelow) to check the node above (resp. above) the newline node that may or may not be there. If the node above the newline requires a newline above then we need to insert an additional newline node.

@pimotte
Copy link
Copy Markdown
Contributor Author

pimotte commented Mar 16, 2026

@DikieDick Thanks! I'm pretty sure I have fixed the issues.

I'm not particularly happy about passing the (serialized) doc into node update, but I'm not sure if we have an architecturally better way that doesn't make the mapping more complicated.

@DikieDick
Copy link
Copy Markdown
Contributor

I added logic to count the actual newlines that are deleted when deleting nodes from the document.

Furthermore:

  • I noticed that in Lean files, inserting a new lean node add this node correctly but the linenumber is one higher than it should be (you can also observe this by the difference between the line number reported in the editor and the line number reported in the bottom right corner of VSCode).
  • Inserting markdown in Lean files does not work correctly. For example: inserting a new markdown cell above or below any code cell within an input area, inserts text right before or after the lean open or close tags. Resulting in invalid files.

@pimotte pimotte mentioned this pull request Apr 2, 2026
@pimotte
Copy link
Copy Markdown
Contributor Author

pimotte commented Apr 2, 2026

Superseded by #87

I'll leave this open for review convenience for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants