Skip to content

Commit

Permalink
Merge pull request #237 from cdepillabout/allow-multiple-wins
Browse files Browse the repository at this point in the history
Small cleanup
  • Loading branch information
cdepillabout authored Oct 22, 2023
2 parents 3f3fe65 + 6382b48 commit fadd12c
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 14 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,25 @@ jobs:

- uses: DeterminateSystems/magic-nix-cache-action@v2

# TODO: This cache actually needs to be keyed on the hash of the
# TODO: These caches actually needs to be keyed on the hash of the
# ./nix-helpers/simple-cabal-shell.nix derivation. If that derivation
# changes, then we really, really should not reuse the same
# ~/.cabal/store directory.
# ~/.cabal/store directory (since there is the possibility of getting
# into a cabal hell, where Haskell libraries in the Cabal store are linked to
# different, incompatible system libraries).
#
# It is possible to get the hash of this derivation with a command like:
#
# $ nix eval --impure --raw --expr 'with (import <nixpkgs> {}).lib; let simpleCabalShell = import ./.nix-helpers/simple-cabal-shell.nix {}; in builtins.elemAt (splitString "-" (removePrefix (builtins.storeDir + "/") simpleCabalShell)) 0'
#
# Just need to load this into a variable, and throw it in the following key name
- uses: actions/cache@v3
name: Cache cabal-store
name: Cache cabal store
with:
path: ~/.config/cabal/store
path: |
~/.cabal/store
~/.config/cabal/store
~/.local/state/cabal/store
key: nix-simple-cabal-shell

- name: cabal update
Expand Down
1 change: 1 addition & 0 deletions .nix-helpers/simple-cabal-shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,6 @@ pkgs.mkShell {
pkgs.xorg.libXdmcp
pkgs.xorg.libxcb
pkgs.xorg.libXtst
pkgs.zlib
];
}
1 change: 0 additions & 1 deletion src/Termonad/App.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import Termonad.Prelude

import Config.Dyre (wrapMain, newParams)
import Control.Lens ((^.), (^..), over, set, view, ix)
import Control.Monad.Fail (fail)
import Data.FileEmbed (embedFile)
import Data.FocusList (focusList, moveFromToFL, updateFocusFL)
import qualified Data.List as List
Expand Down
6 changes: 2 additions & 4 deletions src/Termonad/Config/Colour.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ module Termonad.Config.Colour
-- $setup
) where

import Termonad.Prelude hiding ((\\), index)
import Termonad.Prelude

import Control.Lens ((%~), makeLensesFor)
import Data.Colour
Expand Down Expand Up @@ -124,16 +124,14 @@ import GI.Vte
, terminalSetColorHighlight
, terminalSetColorHighlightForeground
)
import Text.Printf (printf)
import Text.Show (showString)

import Termonad.Lenses (lensCreateTermHook, lensHooks)
import Termonad.Types
( Option(Unset)
, TMConfig
, TMState
, whenSet
)
import Text.Printf (printf)

-- $setup
-- >>> import Data.Colour.Names (green, red)
Expand Down
1 change: 0 additions & 1 deletion src/Termonad/Gtk.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module Termonad.Gtk where

import Termonad.Prelude

import Control.Monad.Fail (MonadFail, fail)
import Data.GI.Base (ManagedPtr, withManagedPtr)
import Data.Text (unpack)
import GHC.Stack (HasCallStack)
Expand Down
12 changes: 10 additions & 2 deletions src/Termonad/Term.hs
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,23 @@ import Termonad.Types
, TMState
, TMState'(TMState, tmStateConfig, tmStateFontDesc)
, TMTerm
, TMWindow
, TMWindowId
, assertInvariantTMState
, createTMNotebookTab
, getNotebookFromTMState
, getTMNotebookFromTMState
, getTMNotebookFromTMState'
, getTMWindowFromTMState
, getTMWindowFromWins
, newTMTerm
, pid
, tmNotebook
, tmNotebookTabTerm
, tmNotebookTabTermContainer
, tmNotebookTabs, TMWindowId, tmStateWindows, getTMWindowFromWins, tmWindowNotebook, getTMWindowFromTMState, getNotebookFromTMState, getTMNotebookFromTMState, getTMNotebookFromTMState', tmWindowAppWin
, tmNotebookTabs
, tmStateWindows
, tmWindowAppWin
, tmWindowNotebook
)

focusTerm :: Int -> TMState -> TMWindowId -> IO ()
Expand Down
2 changes: 0 additions & 2 deletions src/Termonad/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module Termonad.Types where
import Termonad.Prelude

import Control.Lens (ifoldMap)
import Control.Monad.Fail (fail)
import Data.FocusList (FocusList, emptyFL, getFocusItemFL, lengthFL)
import Data.Foldable (toList)
import Data.Unique (Unique, hashUnique, newUnique)
Expand All @@ -32,7 +31,6 @@ import GI.Vte (Terminal, CursorBlinkMode(..))
import Termonad.Gtk (widgetEq)
import Termonad.IdMap (IdMap, IdMapKey, singletonIdMap, lookupIdMap)
import Text.Pretty.Simple (pPrint)
import Text.Show (ShowS, showParen, showString)

-- | A wrapper around a VTE 'Terminal'. This also stores the process ID of the
-- process running on this terminal, as well as a 'Unique' that can be used for
Expand Down

0 comments on commit fadd12c

Please sign in to comment.