Skip to content

Commit

Permalink
⚡ Short output length
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu committed Aug 30, 2023
1 parent 2e03a3b commit ab69bd9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
- id: check-toml
- id: check-json
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.1
rev: v1.5.4
hooks:
- id: remove-crlf
- repo: https://github.com/codespell-project/codespell
Expand Down Expand Up @@ -72,7 +72,7 @@ repos:
additional_dependencies:
- [email protected]
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
Expand All @@ -86,7 +86,7 @@ repos:
additional_dependencies:
- tomli
- repo: https://github.com/kumaraditya303/mirrors-pyright
rev: v1.1.316
rev: v1.1.322
hooks:
- id: pyright
- repo: https://github.com/PyCQA/bandit
Expand Down
8 changes: 5 additions & 3 deletions prompt-style.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,12 @@ local function generate_ps1(char, sections)
local fg, bg, text = table.unpack(v)
if type(text) == "function" then text = text() end
text = string.format(format, text)
if last_bg ~= "" then
ps1 = ps1 .. "%{" .. last_bg .. " " .. bg .. "bg}" .. sep
if last_bg == "" then
ps1 = ps1 .. "%{" .. fg .. " " .. bg .. "bg}" .. text
else
ps1 = ps1 .. "%{" .. last_bg .. " " .. bg .. "bg}" .. sep ..
"%{" .. fg .. "}" .. text
end
ps1 = ps1 .. "%{" .. fg .. " " .. bg .. "bg}" .. text
last_bg = bg
end
end
Expand Down

0 comments on commit ab69bd9

Please sign in to comment.