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]
|
||||
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) =
|
||||
let
|
||||
name = project.name.clip
|
||||
input = state.input.clip
|
||||
projectColor = if project.open: "yellow" else: "default"
|
||||
cur = (if selected: "> " else: " ")
|
||||
|
||||
if project.matched:
|
||||
var displayName = $input.bb("red")
|
||||
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)
|
||||
else:
|
||||
b.addLine(cur & $name.bb(projectColor))
|
||||
b.addLine(cur & $name.bb(project.highlight))
|
||||
|
||||
proc addProjectCount(b: var Buffer) =
|
||||
let
|
||||
|
|
Loading…
Reference in a new issue