mirror of
https://github.com/daylinmorgan/tsm.git
synced 2024-12-22 05:00:44 -06:00
fix: highlight additional open sessions green
This commit is contained in:
parent
6e31c14f7d
commit
bd7fe44ce2
1 changed files with 7 additions and 3 deletions
|
@ -115,20 +115,24 @@ proc clip(s: string): string =
|
||||||
s[0..^maxWidth]
|
s[0..^maxWidth]
|
||||||
else: s
|
else: s
|
||||||
|
|
||||||
|
proc highlight(p: Project): string =
|
||||||
|
if p.location == "": "green"
|
||||||
|
elif p.open: "yellow"
|
||||||
|
else: "default"
|
||||||
|
|
||||||
proc addProject(b: var Buffer, project: Project, selected: bool) =
|
proc addProject(b: var Buffer, project: Project, selected: bool) =
|
||||||
let
|
let
|
||||||
name = project.name.clip
|
name = project.name.clip
|
||||||
input = state.input.clip
|
input = state.input.clip
|
||||||
projectColor = if project.open: "yellow" else: "default"
|
|
||||||
cur = (if selected: "> " else: " ")
|
cur = (if selected: "> " else: " ")
|
||||||
|
|
||||||
if project.matched:
|
if project.matched:
|
||||||
var displayName = $input.bb("red")
|
var displayName = $input.bb("red")
|
||||||
if input.len < name.len:
|
if input.len < name.len:
|
||||||
displayName.add $name[input.len..^1].bb(projectColor)
|
displayName.add $name[input.len..^1].bb(project.highlight)
|
||||||
b.addLine(cur & $displayName)
|
b.addLine(cur & $displayName)
|
||||||
else:
|
else:
|
||||||
b.addLine(cur & $name.bb(projectColor))
|
b.addLine(cur & $name.bb(project.highlight))
|
||||||
|
|
||||||
proc addProjectCount(b: var Buffer) =
|
proc addProjectCount(b: var Buffer) =
|
||||||
let
|
let
|
||||||
|
|
Loading…
Reference in a new issue