yi- The Haskell-Scriptable Editor

Safe HaskellNone



Various high-level functions to further classify.



getAppropriateFiles :: Maybe String -> String -> YiM (String, [String])Source

Given a possible starting path (which if not given defaults to the current directory) and a fragment of a path we find all files within the given (or current) directory which can complete the given path fragment. We return a pair of both directory plus the filenames on their own that is without their directories. The reason for this is that if we return all of the filenames then we get a hint which is way too long to be particularly useful.

getFolder :: Maybe String -> IO StringSource

Given a path, trim the file name bit if it exists. If no path given, return current directory.

matchingFileNames :: Maybe String -> String -> YiM [String]Source

Given a possible path and a prefix, return matching file names.

adjIndent :: IndentBehaviour -> BufferM ()Source

A simple wrapper to adjust the current indentation using the mode specific indentation function but according to the given indent behaviour.

promptFile :: String -> (String -> YiM ()) -> YiM ()Source

Generic emacs style prompt file action. Takes a prompt and a continuation act and prompts the user with file hints

findFileHint :: String -> String -> YiM [String]Source

For use as the hint when opening a file using the minibuffer. We essentially return all the files in the given directory which have the given prefix.