Skip to content

Conversation

@FallenSky2077
Copy link

This PR adds proof-tree support to Mogan using a macro-based approach with environment variables.

Features

  • Three proof-tree variants: unlabeled, right-labeled, left-labeled
  • Keyboard shortcuts: Insert proof-trees from math mode
  • Toolbar support: Focus menu with variant dropdown, insert/remove buttons
  • Structured navigation: Arrow keys navigate between conclusion, premises, and labels
  • Structured editing: Insert/remove premises, insert sub-proofs above/below

Implementation Approach

Instead of adding new C++ primitives, proof-trees are implemented as:
(with "tree-mode" "proof" "tree-label-pos" "" (tree conclusion premise1 premise2 ...))

  • tree-mode = "proof" enables proof-tree rendering
  • tree-label-pos = "none", "left", or "right" controls label position

Delete/Backspace Behavior

  • Visual order: left-label → premises → right-label
  • Boundary delete moves to adjacent field
  • Empty premise deletion (if multiple exist)
  • All-empty removes entire proof-tree

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.

1 participant