Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement TreeMenu, an interactive REPL folding-tree menu #3

Merged
merged 2 commits into from
Jun 13, 2020

Conversation

timholy
Copy link
Member

@timholy timholy commented Jun 11, 2020

This allows one to use a folding tree interactively. As described in the modified README (preview), on suitable Julia versions you can now display a folding tree, scroll through its options with the arrow keys, and collapse entire branches by toggling folding with the spacebar. Being able to implement this was my primary motivation for JuliaLang/julia#35915.

A couple of noteworthy points for any reviewers:

  • the first commit just splits previous code into multiple source files. If you're reviewing, you can probably save yourself some trouble by only looking at the second commit.
  • this PR bumps the package version to 1.0. I don't foresee any necessary API breakage, so other than this PR I am not sure what future development would justify moving to 1.0 if we don't do it now.
  • there's some chance that the new writeoption (see the code) is of sufficiently general interest that I should put it in REPL.Terminals as writemaxchars or something. I am not sure how often people want to restrict text output to a single line, but I've found that when coupled with printstyled coloration, the obvious solution of just truncating a string has significant problems: you can leave the terminal in an unexpected mode, or even truncate in the middle of an ANSI terminal escape sequence. In contrast, this implementation seems quite robust so far.

@codecov-commenter
Copy link

codecov-commenter commented Jun 11, 2020

Codecov Report

Merging #3 into master will increase coverage by 2.59%.
The diff coverage is 97.74%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #3      +/-   ##
==========================================
+ Coverage   95.16%   97.76%   +2.59%     
==========================================
  Files           1        4       +3     
  Lines          62      134      +72     
==========================================
+ Hits           59      131      +72     
  Misses          3        3              
Impacted Files Coverage Δ
src/FoldingTrees.jl 100.00% <ø> (+4.83%) ⬆️
src/foldingtree.jl 95.00% <95.00%> (ø)
src/abstracttrees.jl 100.00% <100.00%> (ø)
src/treemenu.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 82cd0ed...7328020. Read the comment docs.

@timholy timholy merged commit f98bc49 into master Jun 13, 2020
@timholy timholy deleted the teh/treemenu branch June 13, 2020 07:45
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