FileLineGetter

This is a line getter that customizes the tab completion to fill in file names separated by spaces, like a command line thing.

class FileLineGetter : LineGetter {}

Members

Variables

searchDirectory
string searchDirectory;

You can set this property to tell it where to search for the files to complete.

Inherited Members

From LineGetter

dispose
void dispose()

Call this before letting LineGetter die so it can do any necessary cleanup and save the updated history to a file.

historyFileDirectory
string historyFileDirectory()

Override this to change the directory where history files are stored Default is $HOME/.arsd-getline on linux and %APPDATA%/arsd-getline/ on Windows.

suggestionForeground
Color suggestionForeground;

You can customize the colors here. You should set these after construction, but before calling startGettingLine or getline.

prompt
void prompt(string p)
string prompt()

Set this if you want a prompt to be drawn with the line. It does NOT support color in string.

autoSuggest
bool autoSuggest;

Turn on auto suggest if you want a greyed thing of what tab would be able to fill in as you type.

hadInput
bool hadInput()

Returns true if there was any input in the buffer. Can be checked in the case of a UserInterruptionException.

historyFilter
string historyFilter(string candidate)

Override this if you don't want all lines added to the history. You can return null to not add it at all, or you can transform it.

saveSettingsAndHistoryToFile
void saveSettingsAndHistoryToFile()

You may override this to do nothing

historyFileExtension
string historyFileExtension()
loadSettingsAndHistoryFromFile
void loadSettingsAndHistoryFromFile()

You may override this to do nothing

tabComplete
string[] tabComplete(in dchar[] candidate, in dchar[] afterCursor)

Override this to provide tab completion. You may use the candidate argument to filter the list, but you don't have to (LineGetter will do it for you on the values you return). This means you can ignore the arguments if you like.

tabCompleteStartPoint
size_t tabCompleteStartPoint(in dchar[] candidate, in dchar[] afterCursor)

Override this to provide a different tab competition starting point. The default is 0, always completing the complete line, but you may return the index of another character of candidate to provide a new split.

tabCompleteHelp
string tabCompleteHelp(string candidate)

This gives extra information for an item when displaying tab competition details.

showTabCompleteList
void showTabCompleteList(string[] list)

Override this to provide a custom display of the tab completion list.

showHelp
void showHelp()

Called by the default event loop when the user presses F1. Override showHelp to change the UI, override helpMessage if you just want to change the message.

helpMessage
string helpMessage()
editLineInEditor
dchar[] editLineInEditor(in dchar[] line, in size_t cursorPosition)
getline
string getline(RealTimeConsoleInput* input = null)

One-call shop for the main workhorse If you already have a RealTimeConsoleInput ready to go, you should pass a pointer to yours here. Otherwise, LineGetter will make its own.

addChar
void addChar(dchar ch)

Adds a character at the current position in the line. You can call this too if you hook events for hotkeys or something. You'll probably want to call redraw() after adding chars.

addString
void addString(string s)

.

deleteChar
void deleteChar()

Deletes the character at the current position in the line. You'll probably want to call redraw() after deleting chars.

deleteToEndOfLine
void deleteToEndOfLine()
startGettingLine
void startGettingLine()

Starts getting a new line. Call workOnLine and finishGettingLine afterward. Make sure that you've flushed your input and output before calling this function or else you might lose events or get exceptions from this.

pastePreprocessor
string delegate(string s) pastePreprocessor;
workOnLine
bool workOnLine(InputEvent e, RealTimeConsoleInput* rtti = null)

for integrating into another event loop you can pass individual events to this and the line getter will work on it

Meta