From 1e7826443a719d5dc557b27d6010bd18c82e080a Mon Sep 17 00:00:00 2001 From: Lyndon White Date: Tue, 5 Jan 2021 23:21:07 +0000 Subject: [PATCH] Remove internal completion function and just use identical simpleCompletion internally --- System/Console/Haskeline/Completion.hs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/System/Console/Haskeline/Completion.hs b/System/Console/Haskeline/Completion.hs index 04b8e9a9..11cc3576 100644 --- a/System/Console/Haskeline/Completion.hs +++ b/System/Console/Haskeline/Completion.hs @@ -86,7 +86,7 @@ completeWordWithPrev esc ws f (line, _) = do -- | Create a finished completion out of the given word. simpleCompletion :: String -> Completion -simpleCompletion = completion +simpleCompletion = Completion str str True -- NOTE: this is the same as for readline, except that I took out the '\\' -- so they can be used as a path separator. @@ -99,9 +99,6 @@ completeFilename = completeQuotedWord (Just '\\') "\"'" listFiles $ completeWord (Just '\\') ("\"\'" ++ filenameWordBreakChars) listFiles -completion :: String -> Completion -completion str = Completion str str True - setReplacement :: (String -> String) -> Completion -> Completion setReplacement f c = c {replacement = f $ replacement c} @@ -165,7 +162,7 @@ listFiles path = liftIO $ do -- get all of the files in that directory, as basenames allFiles <- if not dirExists then return [] - else fmap (map completion . filterPrefix) + else fmap (map simpleCompletion . filterPrefix) $ getDirectoryContents fixedDir -- The replacement text should include the directory part, and also -- have a trailing slash if it's itself a directory.