Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
dbe1ff2a
Commit
dbe1ff2a
authored
12 years ago
by
mcmlxxix
Browse files
Options
Downloads
Patches
Plain Diff
fix branch alignment and trim lines wider than frame
parent
0ea56b49
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/load/tree.js
+19
-17
19 additions, 17 deletions
exec/load/tree.js
with
19 additions
and
17 deletions
exec/load/tree.js
+
19
−
17
View file @
dbe1ff2a
...
...
@@ -377,14 +377,15 @@ function Tree(frame,text,tree) {
var
y
;
var
x
;
var
ch
;
var
attr
;
/* push tree items into frame */
for
(
y
=
0
;
y
<
output
.
length
;
y
++
)
{
for
(
x
=
0
;
x
<
output
[
y
].
length
;
x
++
)
{
ch
=
output
[
y
][
x
].
ch
;
attr
=
output
[
y
][
x
].
attr
;
var
ch
;
var
attr
;
var
line
=
output
[
y
].
splice
(
0
,
this
.
frame
.
width
);
for
(
x
=
0
;
x
<
line
.
length
;
x
++
)
{
ch
=
line
[
x
].
ch
;
attr
=
line
[
x
].
attr
;
this
.
frame
.
setData
(
x
,
y
,
ch
,
attr
,
false
);
}
/* clear remaining spaces at end of line */
...
...
@@ -551,18 +552,19 @@ function Tree(frame,text,tree) {
/* add indentation on subtrees */
for
(
var
i
=
0
;
i
<
this
.
depth
-
1
;
i
++
)
list
.
push
({
ch
:
"
"
,
attr
:
bg
+
fg
});
/* do not draw tree branches on top level tree */
if
(
this
.
depth
==
1
)
list
.
push
({
ch
:
"
"
,
attr
:
bg
+
fg
});
/* if this is the bottom of a subtree */
else
if
(
last
)
{
fg
=
this
.
colors
.
tfg
;
list
.
push
({
ch
:
"
\
xC0
"
,
attr
:
bg
+
fg
});
}
/* otherwise draw a right-hand tee for a tree item */
else
{
fg
=
this
.
colors
.
tfg
;
list
.
push
({
ch
:
"
\
xC3
"
,
attr
:
bg
+
fg
});
if
(
this
.
depth
>
1
)
{
/* if this is the bottom of a subtree */
if
(
last
)
{
fg
=
this
.
colors
.
tfg
;
list
.
push
({
ch
:
"
\
xC0
"
,
attr
:
bg
+
fg
})
;
}
/* otherwise draw a right-hand tee for a tree item */
else
{
fg
=
this
.
colors
.
tfg
;
list
.
push
({
ch
:
"
\
xC3
"
,
attr
:
bg
+
fg
})
;
}
}
fg
=
this
.
colors
.
xfg
;
...
...
@@ -782,7 +784,7 @@ function TreeItem(text,parent,func,args) {
}
/* add indentation on subtrees */
for
(
var
i
=
0
;
i
<
this
.
depth
-
1
;
i
++
)
for
(
var
i
=
0
;
i
<
this
.
depth
-
2
;
i
++
)
list
.
push
({
ch
:
"
"
,
attr
:
bg
+
fg
});
/* do not draw tree branches on top level tree */
if
(
this
.
depth
==
1
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment