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
Add box-drawing character to the snapshots command #728
Conversation
@@ -115,7 +115,12 @@ func runSnapshots(opts SnapshotOptions, gopts GlobalOptions, args []string) erro | |||
tag = sn.Tags[i] | |||
} | |||
|
|||
tab.Rows = append(tab.Rows, []interface{}{"", "", "", tag, path}) | |||
tree_element := "│ ├──" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use underscores in Go names; var tree_element should be treeElement
Current coverage is 54.17% (diff: 0.00%)@@ master #728 diff @@
==========================================
Files 95 95
Lines 7263 7269 +6
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 3943 3938 -5
- Misses 2742 2754 +12
+ Partials 578 577 -1
|
Thanks for your contribution! I have two questions:
I'd prefer to draw the tree where the directories are listed, in the right-most column, what do you think? |
I have tested it with Windows 7 and powershell and it seems to work: However, if the a terminal/shell does not support unicode, I think the output will look strange. I think to solve this problem is to check if the shell supports unicode and if not change the output to an ASCII representation (similar to
The actual problem that I had with the previous snapshots output was that I thought a line without an ID is a corrupted snapshot. At first sight it was not clear to me that a line without an ID belongs to the previous line with an ID. That is why I put the tree in the left-most column to the ID. However, I can give it a try and post an example here to see if this increases the visualisation:
Do you think this improves the visualisation? |
Thanks for the example. I think that this indeed looks better when the tree is drawn in the rightmost column. If it works on Windows 7 I think that's sufficient, let's see if we get any reports from people with non-utf-8 terminals. I'm currently thinking if there's a better way to solve your original problem in a better way. I've thought about inserting a line ( |
What do you think about this:
|
I can't really imagine what |
By the way: What's the software in the screenshot? |
Sure this presentation solves the problem for me. It was https://github.com/liangxianzhe/oh-my-vim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks a lot for your work!
Could you please squash your commits (using |
Remove underscore of variable name Format code with gofmt Change snapshot output according to the discussion
5c4bbef
to
54c2f62
Compare
Add box-drawing character to the snapshots command
Merged, thanks a lot for your contribution! |
The following pull request adds box-drawing characters to the output of the snapshot command to visualize which directory belongs to which snapshot. It looks like the following: