Compare commits
1 Commits
ci3
...
bump-versi
| Author | SHA1 | Date | |
|---|---|---|---|
| 8573db904e |
2
.github/workflows/cross.yaml
vendored
2
.github/workflows/cross.yaml
vendored
@@ -19,7 +19,7 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build linux binary
|
name: Build linux binary
|
||||||
runs-on: [self-hosted, Linux, X64, maerwald]
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
CABAL_VER: 3.10.1.0
|
CABAL_VER: 3.10.1.0
|
||||||
JSON_VERSION: "0.0.7"
|
JSON_VERSION: "0.0.7"
|
||||||
|
|||||||
2
.github/workflows/docker.yaml
vendored
2
.github/workflows/docker.yaml
vendored
@@ -57,7 +57,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: docker://arm64v8/ubuntu:focal
|
- uses: docker://arm64v8/ubuntu:focal
|
||||||
name: Cleanup (aarch64 linux)
|
name: Cleanup (aarch64 linux)
|
||||||
continue-on-error: true
|
|
||||||
with:
|
with:
|
||||||
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
||||||
|
|
||||||
@@ -94,7 +93,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: docker://arm64v8/ubuntu:focal
|
- uses: docker://arm64v8/ubuntu:focal
|
||||||
name: Cleanup (aarch64 linux)
|
name: Cleanup (aarch64 linux)
|
||||||
continue-on-error: true
|
|
||||||
with:
|
with:
|
||||||
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
@@ -105,7 +105,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: docker://arm64v8/debian:10
|
- uses: docker://arm64v8/debian:10
|
||||||
name: Cleanup (aarch64 linux)
|
name: Cleanup (aarch64 linux)
|
||||||
continue-on-error: true
|
|
||||||
with:
|
with:
|
||||||
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
||||||
|
|
||||||
@@ -349,7 +348,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: docker://arm64v8/debian:10
|
- uses: docker://arm64v8/debian:10
|
||||||
name: Cleanup (aarch64 linux)
|
name: Cleanup (aarch64 linux)
|
||||||
continue-on-error: true
|
|
||||||
with:
|
with:
|
||||||
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
{-# LANGUAGE MultiParamTypeClasses #-}
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
{-# LANGUAGE BangPatterns #-}
|
{-# LANGUAGE BangPatterns #-}
|
||||||
{-# LANGUAGE ViewPatterns #-}
|
|
||||||
|
|
||||||
module BrickMain where
|
module BrickMain where
|
||||||
|
|
||||||
@@ -203,35 +202,34 @@ handleGenericListEvent (VtyEvent ev) = do
|
|||||||
handleGenericListEvent _ = pure ()
|
handleGenericListEvent _ = pure ()
|
||||||
|
|
||||||
-- This re-uses Brick.Widget.List.renderList
|
-- This re-uses Brick.Widget.List.renderList
|
||||||
renderSectionList :: forall n t e . (Traversable t, Ord n, Show n, Eq n, L.Splittable t, Semigroup (t e))
|
renderSectionList :: (Traversable t, Ord n, Show n, Eq n, L.Splittable t)
|
||||||
=> (Bool -> e -> Widget n) -- ^ Rendering function of the list element, True for the selected element
|
=> (Bool -> e -> Widget n) -- ^ Rendering function of the list element, True for the selected element
|
||||||
-> Bool -- ^ Whether the section list has focus
|
-> Bool -- ^ Whether the section list has focus
|
||||||
-> GenericSectionList n t e -- ^ The section list to render
|
-> GenericSectionList n t e -- ^ The section list to render
|
||||||
-> Widget n
|
-> Widget n
|
||||||
renderSectionList renderElem sectionFocus ge@(GenericSectionList focus elms slName) =
|
renderSectionList render_elem section_focus (GenericSectionList focus elms sl_name) =
|
||||||
Brick.Widget Brick.Greedy Brick.Greedy $ Brick.render $ Brick.viewport slName Brick.Vertical $
|
Brick.Widget Brick.Greedy Brick.Greedy $ do
|
||||||
V.ifoldl' (\(!accWidget) !i list ->
|
c <- Brick.getContext
|
||||||
let hasFocusList = sectionIsFocused list
|
let -- A section is focused if the whole thing is focused, and the inner list has focus
|
||||||
makeVisible = if hasFocusList then Brick.visibleRegion (Brick.Location (c, r)) (1, 1) else id
|
section_is_focused l = section_focus && (Just (L.listName l) == F.focusGetCurrent focus)
|
||||||
appendBorder = if i == 0 then id else (hBorder <=>)
|
-- We need to limit the widget size when the length of the list is higher than the size of the terminal
|
||||||
newWidget = appendBorder (makeVisible $ renderInnerList hasFocusList list)
|
limit = min (Brick.windowHeight c) (Brick.availHeight c)
|
||||||
in accWidget <=> newWidget
|
s_idx = fromMaybe 0 $ V.findIndex section_is_focused elms
|
||||||
)
|
render_inner_list has_focus l = Brick.vLimit (length l) $ L.renderList (\b -> render_elem (b && has_focus)) has_focus l
|
||||||
Brick.emptyWidget
|
(widget, off) =
|
||||||
elms
|
V.ifoldl' (\wacc i list ->
|
||||||
where
|
let has_focus_list = section_is_focused list
|
||||||
-- A section is focused if the whole thing is focused, and the inner list has focus
|
(!acc_widget, !acc_off) = wacc
|
||||||
sectionIsFocused :: L.GenericList n t e -> Bool
|
new_widget = if i == 0 then render_inner_list has_focus_list list else hBorder <=> render_inner_list has_focus_list list
|
||||||
sectionIsFocused l = sectionFocus && (Just (L.listName l) == F.focusGetCurrent focus)
|
new_off
|
||||||
|
| i < s_idx = 1 + L.listItemHeight list * length list
|
||||||
renderInnerList :: Bool -> L.GenericList n t e -> Widget n
|
| i == s_idx = 1 + L.listItemHeight list * fromMaybe 0 (L.listSelected list)
|
||||||
renderInnerList hasFocus l = Brick.vLimit (length l) $ L.renderList (\b -> renderElem (b && hasFocus)) hasFocus l
|
| otherwise = 0
|
||||||
|
in (acc_widget <=> new_widget, acc_off + new_off)
|
||||||
-- compute the location to focus on within the active section
|
)
|
||||||
(c, r) :: (Int, Int) = case sectionListSelectedElement ge of
|
(Brick.emptyWidget, 0)
|
||||||
Nothing -> (0, 0)
|
elms
|
||||||
Just (selElIx, _) -> (0, selElIx)
|
Brick.render $ Brick.viewport sl_name Brick.Vertical $ Brick.translateBy (Brick.Location (0, min 0 (limit-off))) widget
|
||||||
|
|
||||||
|
|
||||||
-- | Equivalent to listSelectedElement
|
-- | Equivalent to listSelectedElement
|
||||||
sectionListSelectedElement :: (Eq n, L.Splittable t, Traversable t, Semigroup (t e)) => GenericSectionList n t e -> Maybe (Int, e)
|
sectionListSelectedElement :: (Eq n, L.Splittable t, Traversable t, Semigroup (t e)) => GenericSectionList n t e -> Maybe (Int, e)
|
||||||
|
|||||||
@@ -26,11 +26,6 @@ source-repository-package
|
|||||||
location: https://github.com/hasufell/uri-bytestring.git
|
location: https://github.com/hasufell/uri-bytestring.git
|
||||||
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
||||||
|
|
||||||
source-repository-package
|
|
||||||
type: git
|
|
||||||
location: https://github.com/hasufell/versions.git
|
|
||||||
tag: 79e18fbc44fae3064d8957c550cc0229465db320
|
|
||||||
|
|
||||||
package libarchive
|
package libarchive
|
||||||
flags: -system-libarchive
|
flags: -system-libarchive
|
||||||
|
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ constraints: any.Cabal ==3.6.3.0,
|
|||||||
vector +boundschecks -internalchecks -unsafechecks -wall,
|
vector +boundschecks -internalchecks -unsafechecks -wall,
|
||||||
any.vector-binary-instances ==0.2.5.2,
|
any.vector-binary-instances ==0.2.5.2,
|
||||||
any.vector-stream ==0.1.0.1,
|
any.vector-stream ==0.1.0.1,
|
||||||
any.versions ==6.0.4,
|
any.versions ==6.0.5,
|
||||||
any.vty ==6.0,
|
any.vty ==6.0,
|
||||||
any.vty-crossplatform ==0.2.0.0,
|
any.vty-crossplatform ==0.2.0.0,
|
||||||
vty-crossplatform -demos,
|
vty-crossplatform -demos,
|
||||||
|
|||||||
@@ -26,11 +26,6 @@ source-repository-package
|
|||||||
location: https://github.com/hasufell/uri-bytestring.git
|
location: https://github.com/hasufell/uri-bytestring.git
|
||||||
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
||||||
|
|
||||||
source-repository-package
|
|
||||||
type: git
|
|
||||||
location: https://github.com/hasufell/versions.git
|
|
||||||
tag: 79e18fbc44fae3064d8957c550cc0229465db320
|
|
||||||
|
|
||||||
package libarchive
|
package libarchive
|
||||||
flags: -system-libarchive
|
flags: -system-libarchive
|
||||||
|
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ constraints: any.Cabal ==3.6.3.0,
|
|||||||
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
|
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
|
||||||
any.vector-binary-instances ==0.2.5.2,
|
any.vector-binary-instances ==0.2.5.2,
|
||||||
any.vector-stream ==0.1.0.1,
|
any.vector-stream ==0.1.0.1,
|
||||||
any.versions ==6.0.4,
|
any.versions ==6.0.5,
|
||||||
any.vty ==6.0,
|
any.vty ==6.0,
|
||||||
any.vty-crossplatform ==0.2.0.0,
|
any.vty-crossplatform ==0.2.0.0,
|
||||||
vty-crossplatform -demos,
|
vty-crossplatform -demos,
|
||||||
|
|||||||
@@ -26,11 +26,6 @@ source-repository-package
|
|||||||
location: https://github.com/hasufell/uri-bytestring.git
|
location: https://github.com/hasufell/uri-bytestring.git
|
||||||
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
||||||
|
|
||||||
source-repository-package
|
|
||||||
type: git
|
|
||||||
location: https://github.com/hasufell/versions.git
|
|
||||||
tag: 79e18fbc44fae3064d8957c550cc0229465db320
|
|
||||||
|
|
||||||
package libarchive
|
package libarchive
|
||||||
flags: -system-libarchive
|
flags: -system-libarchive
|
||||||
|
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ constraints: any.Cabal ==3.6.3.0,
|
|||||||
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
|
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
|
||||||
any.vector-binary-instances ==0.2.5.2,
|
any.vector-binary-instances ==0.2.5.2,
|
||||||
any.vector-stream ==0.1.0.1,
|
any.vector-stream ==0.1.0.1,
|
||||||
any.versions ==6.0.4,
|
any.versions ==6.0.5,
|
||||||
any.vty ==6.0,
|
any.vty ==6.0,
|
||||||
any.vty-crossplatform ==0.2.0.0,
|
any.vty-crossplatform ==0.2.0.0,
|
||||||
vty-crossplatform -demos,
|
vty-crossplatform -demos,
|
||||||
|
|||||||
@@ -26,11 +26,6 @@ source-repository-package
|
|||||||
location: https://github.com/hasufell/uri-bytestring.git
|
location: https://github.com/hasufell/uri-bytestring.git
|
||||||
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
||||||
|
|
||||||
source-repository-package
|
|
||||||
type: git
|
|
||||||
location: https://github.com/hasufell/versions.git
|
|
||||||
tag: 79e18fbc44fae3064d8957c550cc0229465db320
|
|
||||||
|
|
||||||
package libarchive
|
package libarchive
|
||||||
flags: -system-libarchive
|
flags: -system-libarchive
|
||||||
|
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ constraints: any.Cabal ==3.6.3.0 || ==3.8.1.0,
|
|||||||
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
|
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
|
||||||
any.vector-binary-instances ==0.2.5.2,
|
any.vector-binary-instances ==0.2.5.2,
|
||||||
any.vector-stream ==0.1.0.1,
|
any.vector-stream ==0.1.0.1,
|
||||||
any.versions ==6.0.4,
|
any.versions ==6.0.5,
|
||||||
any.vty ==6.0,
|
any.vty ==6.0,
|
||||||
any.vty-crossplatform ==0.2.0.0,
|
any.vty-crossplatform ==0.2.0.0,
|
||||||
vty-crossplatform -demos,
|
vty-crossplatform -demos,
|
||||||
|
|||||||
@@ -26,11 +26,6 @@ source-repository-package
|
|||||||
location: https://github.com/hasufell/uri-bytestring.git
|
location: https://github.com/hasufell/uri-bytestring.git
|
||||||
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
||||||
|
|
||||||
source-repository-package
|
|
||||||
type: git
|
|
||||||
location: https://github.com/hasufell/versions.git
|
|
||||||
tag: 79e18fbc44fae3064d8957c550cc0229465db320
|
|
||||||
|
|
||||||
package libarchive
|
package libarchive
|
||||||
flags: -system-libarchive
|
flags: -system-libarchive
|
||||||
|
|
||||||
|
|||||||
@@ -56,10 +56,5 @@ source-repository-package
|
|||||||
location: https://github.com/hasufell/uri-bytestring.git
|
location: https://github.com/hasufell/uri-bytestring.git
|
||||||
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
||||||
|
|
||||||
source-repository-package
|
|
||||||
type: git
|
|
||||||
location: https://github.com/hasufell/versions.git
|
|
||||||
tag: 79e18fbc44fae3064d8957c550cc0229465db320
|
|
||||||
|
|
||||||
allow-newer: cabal-install-parsers:tar
|
allow-newer: cabal-install-parsers:tar
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ common app-common-depends
|
|||||||
, uri-bytestring ^>=0.3.2.2
|
, uri-bytestring ^>=0.3.2.2
|
||||||
, utf8-string ^>=1.0
|
, utf8-string ^>=1.0
|
||||||
, vector >=0.12 && <0.14
|
, vector >=0.12 && <0.14
|
||||||
, versions >=6.0.3 && <6.1
|
, versions >=6.0.5 && <6.1
|
||||||
, yaml-streamly ^>=0.12.0
|
, yaml-streamly ^>=0.12.0
|
||||||
|
|
||||||
if flag(tar)
|
if flag(tar)
|
||||||
@@ -212,7 +212,7 @@ library
|
|||||||
, unordered-containers ^>=0.2.10.0
|
, unordered-containers ^>=0.2.10.0
|
||||||
, uri-bytestring ^>=0.3.2.2
|
, uri-bytestring ^>=0.3.2.2
|
||||||
, vector >=0.12 && <0.14
|
, vector >=0.12 && <0.14
|
||||||
, versions >=6.0.3 && <6.1
|
, versions >=6.0.5 && <6.1
|
||||||
, word8 ^>=0.1.3
|
, word8 ^>=0.1.3
|
||||||
, yaml-streamly ^>=0.12.0
|
, yaml-streamly ^>=0.12.0
|
||||||
, zlib ^>=0.6.2.2
|
, zlib ^>=0.6.2.2
|
||||||
@@ -408,7 +408,7 @@ test-suite ghcup-test
|
|||||||
, text ^>=2.0
|
, text ^>=2.0
|
||||||
, time >=1.9.3 && <1.12
|
, time >=1.9.3 && <1.12
|
||||||
, uri-bytestring ^>=0.3.2.2
|
, uri-bytestring ^>=0.3.2.2
|
||||||
, versions >=6.0.3 && <6.1
|
, versions >=6.0.5 && <6.1
|
||||||
|
|
||||||
if os(windows)
|
if os(windows)
|
||||||
cpp-options: -DIS_WINDOWS
|
cpp-options: -DIS_WINDOWS
|
||||||
|
|||||||
Reference in New Issue
Block a user