Skip to content

Commit

Permalink
Merge pull request #20 from pmonks/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
pmonks authored Sep 12, 2023
2 parents 52e32bc + cda1d17 commit 4bf5f70
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
java-version: [ 11, 17 ] # Note: logback no longer supports Java 8, so we've dropped that from the matrix

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
- uses: DeLaGuardo/setup-clojure@9.5
- uses: DeLaGuardo/setup-clojure@12.1
with:
cli: latest
- uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ jobs:
container:
image: uochan/antq
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: java -jar /tmp/antq/antq.jar --skip=pom --exclude=com.github.pmonks/pbr --error-format="::error file={{file}}::{{message}}"
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
environment: clojars

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Make sure we get the full history, or else the version number gets screwed up
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- uses: DeLaGuardo/setup-clojure@9.5
- uses: DeLaGuardo/setup-clojure@12.1
with:
cli: latest
- uses: actions/cache@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- uses: DeLaGuardo/setup-clojure@9.5
- uses: DeLaGuardo/setup-clojure@12.1
with:
cli: latest
- uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
{jansi-clj/jansi-clj {:mvn/version "1.0.1"}
com.github.pmonks/clj-wcwidth {:mvn/version "1.0.64"}}
:aliases
{:build {:deps {io.github.clojure/tools.build {:git/tag "v0.8.3" :git/sha "0d20256"}
{:build {:deps {io.github.clojure/tools.build {:git/tag "v0.9.5" :git/sha "24f2894"}
com.github.pmonks/pbr {:mvn/version "RELEASE"}}
:ns-default pbr.build}}}
Binary file modified spinner-demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 6 additions & 9 deletions src/progress/determinate.clj
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ since your dog last pooped."
:tip "🟨"}
})

(defn- col1-and-erase-to-eol!
[]
(print "\r")
(jansi/erase-line!)
(flush))

(defn- clamp
"Clamps a value within a range."
[mn mx x]
Expand All @@ -90,8 +84,10 @@ since your dog last pooped."
(when line
(ansi/save-cursor!)
(jansi/cursor! 1 line))
(col1-and-erase-to-eol!)
(print (str ; Label (optional)
(print (str ; Go to the start of the line
"\r"

; Label (optional)
(when-not (s/blank? label)
(ansi/apply-colours-and-attrs (:label-fg-colour style)
(:label-bg-colour style)
Expand Down Expand Up @@ -137,6 +133,7 @@ since your dog last pooped."
(:units-bg-colour style)
(:units-attrs style)
(str " " units))))))))
(jansi/erase-line!)
(when line (ansi/restore-cursor!))
(flush))))

Expand Down Expand Up @@ -224,7 +221,7 @@ opts is a map, optionally containing these keys:
(when line
(ansi/save-cursor!)
(jansi/cursor! 1 line))
(col1-and-erase-to-eol!)
(print "\r")
(when line (ansi/restore-cursor!))))
(flush))))))))

Expand Down

0 comments on commit 4bf5f70

Please sign in to comment.