From e3f24f710a5e1c6061f646e4ef4d644a6b715872 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Tue, 19 Mar 2024 12:44:25 -0500 Subject: [PATCH] fix: update bbansi version to stop swallowing characters --- config.nims | 3 +++ nimble.lock | 40 ++++++++++++++++++++-------------------- nix/lock.json | 8 ++++---- src/selector.nim | 11 ++++++----- tsm.nimble | 2 +- 5 files changed, 34 insertions(+), 30 deletions(-) diff --git a/config.nims b/config.nims index 2bdf27e..ab1055d 100644 --- a/config.nims +++ b/config.nims @@ -14,6 +14,9 @@ task release, "build release assets": version = (gorgeEx "git describe --tags --always --match 'v*'").output exec &"forge release -v {version} -V" +task updateNixLock, "regenerate nix/lock.json": + exec "nix run github:daylinmorgan/nnl nimble.lock > nix/lock.json" + task bundle, "package build assets": withDir "dist": for dir in listDirs("."): diff --git a/nimble.lock b/nimble.lock index e081aa1..21345be 100644 --- a/nimble.lock +++ b/nimble.lock @@ -1,6 +1,26 @@ { "version": 2, "packages": { + "bbansi": { + "version": "0.1.1", + "vcsRevision": "9a85d9ed028f06f1ed1ee6851480a51408a6004e", + "url": "https://github.com/daylinmorgan/bbansi", + "downloadMethod": "git", + "dependencies": [], + "checksums": { + "sha1": "b338433f9a7a1b788b7583674c2b14096ced29ee" + } + }, + "usu": { + "version": "0.1.0", + "vcsRevision": "25574d165bb7f60900b36590bc49f3d90e47cea4", + "url": "https://github.com/usu-dev/usu-nim", + "downloadMethod": "git", + "dependencies": [], + "checksums": { + "sha1": "61a8c13946e3eea9dbe04a6141ed93811563026c" + } + }, "cligen": { "version": "1.7.0", "vcsRevision": "4193f802796f15559c81c6dd56724d6f20345917", @@ -20,26 +40,6 @@ "checksums": { "sha1": "7109f26fc632ceed85e0c48afe55051948c1bc61" } - }, - "bbansi": { - "version": "0.1.0", - "vcsRevision": "e77ad85cd3a68cabd6ef66727fa1a0cd14c4d0d3", - "url": "https://github.com/daylinmorgan/bbansi", - "downloadMethod": "git", - "dependencies": [], - "checksums": { - "sha1": "f47cade0fa02ef944d76e31199762b26389bb9a9" - } - }, - "usu": { - "version": "0.1.0", - "vcsRevision": "25574d165bb7f60900b36590bc49f3d90e47cea4", - "url": "https://github.com/usu-dev/usu-nim", - "downloadMethod": "git", - "dependencies": [], - "checksums": { - "sha1": "61a8c13946e3eea9dbe04a6141ed93811563026c" - } } }, "tasks": {} diff --git a/nix/lock.json b/nix/lock.json index d097c36..31e41bc 100644 --- a/nix/lock.json +++ b/nix/lock.json @@ -38,11 +38,11 @@ }, { "method": "fetchzip", - "path": "/nix/store/m086yq0f29cg98w3b12d70cw7xki1j39-source", - "rev": "e77ad85cd3a68cabd6ef66727fa1a0cd14c4d0d3", - "sha256": "1l5a5kwviq76kxzagljzpwzc3p43qz7wzs5zvrqi5c59klw1967c", + "path": "/nix/store/ws9bc49njd13lzlankiw9vz85h56n0sn-source", + "rev": "9a85d9ed028f06f1ed1ee6851480a51408a6004e", + "sha256": "04r9wincqd4a5hmxixbsw0zjpvlrpckny4jkzahvbnh8s5f1xlc6", "srcDir": "src", - "url": "https://github.com/daylinmorgan/bbansi/archive/e77ad85cd3a68cabd6ef66727fa1a0cd14c4d0d3.tar.gz", + "url": "https://github.com/daylinmorgan/bbansi/archive/9a85d9ed028f06f1ed1ee6851480a51408a6004e.tar.gz", "subDir": "", "packages": [ "bbansi" diff --git a/src/selector.nim b/src/selector.nim index 84a0cb1..1bcb2f4 100644 --- a/src/selector.nim +++ b/src/selector.nim @@ -128,9 +128,9 @@ proc clip(s: string): string = else: s proc highlight(p: Project): string = - if p.named: "red" - elif p.location == "": "green" + if p.location == "": "green" elif p.open: "yellow" + elif p.named: "bold cyan" else: "default" proc addProject(b: var Buffer, project: Project, selected: bool) = @@ -140,10 +140,11 @@ proc addProject(b: var Buffer, project: Project, selected: bool) = cur = (if selected: "> " else: " ") if project.matched: - var displayName = $input.bb("red") + var displayName = fmt"[red]{input}[/]" if input.len < name.len: - displayName.add $name[input.len..^1].bb(project.highlight) - b.addLine(cur & $displayName) + # bbansi missing add(string, bbstring) interface + displayName = displayName & fmt"[{project.highlight}]{name[input.len..^1]}[/{project.highlight}]" + b.addLine(cur & $displayName.bb) else: b.addLine(cur & $name.bb(project.highlight)) diff --git a/tsm.nimble b/tsm.nimble index ac03376..a0f8ce0 100644 --- a/tsm.nimble +++ b/tsm.nimble @@ -15,6 +15,6 @@ requires "nim >= 2.0.0" requires "https://github.com/inv2004/illwill/#449ae5d2f05aba125d5a71823ff1da55b1766d70" # requires "illwill == 0.3.2", requires "cligen" -requires "https://github.com/daylinmorgan/bbansi >= 0.1.0" +requires "https://github.com/daylinmorgan/bbansi >= 0.1.1" requires "https://github.com/usu-dev/usu-nim"