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

draw: avoid overwriting existing branch char and make use of compact space if enabled #63

Closed
wants to merge 1 commit into from

Conversation

jdtsmith
Copy link
Contributor

@jdtsmith jdtsmith commented Mar 13, 2023

I noticed that branch unicode characters never actually appear in buffer. They get replaced by vertical-stem:

○─○─○─○─○─○─○─○─○─○─○─○─○
  │─○   └─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○
  │ └─○─○─○─○─○─○─○─○─○   └─○─○─○─○─○─○─○─○─○─○
  │   └─○─○─○─○       └─○   └─○─○─○─○─○─○─○─○
  └─○─○─○─○             └─○

What is happening is that as additional children beyond the first are drawn in, the is written over the top of . This PR fixes that by inserting only if the position is blank or eol (i.e. not overwriting).

I also harvest the one additional space available with vundo-compact-display.

Final result looks like:

○─○─○─○─○─○─○─○─○─○─○─○─○
  ├─○─○ └─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○─○
  └─○ ├─○─○─○─○─○─○─○─○─○ └─○─○─○─○─○─○─○─○─○─○
    │ └─○─○─○─○         └─○ └─○─○─○─○─○─○─○─○
    └─○─○─○

@jdtsmith jdtsmith changed the title draw: avoid overwriting existing branch char and use compact space draw: avoid overwriting existing branch char and make use of compact space if enabled Mar 13, 2023
@jdtsmith
Copy link
Contributor Author

jdtsmith commented Apr 26, 2023

Just checking to see if you had had time to look into this @casouri. Pretty minor fix, related to #64 (which adds a clarifying feature).

@casouri
Copy link
Owner

casouri commented Apr 28, 2023

Cool, I made some changes, could you test it out for me please? They are at fix-branch-char2 branch.

@jdtsmith
Copy link
Contributor Author

Nice, thanks. I tested your version. It looks like in rare cases with "extra-long child branch connectors" where vundo has to make extra room for the next child, the branch char inadvertently gets used; check above the selected node.

I made this with my vundo-stress-test, btw, which I have found is a great way to make a random tree of a given branch width and density. [Side note: when this is used to prepare larger trees, vundo tends to hit assert errors; probably worth looking into at some point.]

image

@casouri
Copy link
Owner

casouri commented May 2, 2023

Ah, I see, dumb mistake. I pushed the change.

@jdtsmith jdtsmith closed this May 2, 2023
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