-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
src/term.c:182: term_set_attr: Assertion `attr.x.color == term->attr.x.color || attr.x.color == IC_COLOR_NONE' failed.
Line 182 in c9310ae
| assert(attr.x.color == term->attr.x.color || attr.x.color == IC_COLOR_NONE); |
Here's what my Haskell code looks like:
readIsocline :: CommandExt cExt -> IO String
readIsocline cExts = do
let extraPrompt = "" -- prompt will be "> "
Isocline.readlineEx
extraPrompt
(Just completer)
(Just highlighter)
where
allCmdNames :: [String]
allCmdNames = map (Text.unpack . Cmd.name cExts) (Cmd.allCmds cExts)
completer :: Isocline.CompletionEnv -> String -> IO ()
completer cEnv input = do
let roots = ["."]
let exts = [] -- any extension
let dirSep = Nothing -- system
Isocline.completeFileName cEnv input dirSep roots exts
let isWordChar = Nothing -- default
let wordCompleter inp = Isocline.completionsFor inp allCmdNames
Isocline.completeWord cEnv input isWordChar wordCompleter
allCmdSet :: Set String
allCmdSet = Set.fromList allCmdNames
highlighter :: String -> Isocline.Fmt
highlighter input =
case words input of
(cmd : args) ->
if cmd `Set.member` allCmdSet
then unwords (Isocline.style "bold" cmd : args)
else input
[] -> inputThe same thing happens when you replace bold with cyan.
Metadata
Metadata
Assignees
Labels
No labels