Class Autocomplete | Terminal.Gui v1 (original) (raw)
Namespace
Assembly
Terminal.Gui.dll
Renders an overlay on another view at a given point that allows selecting from a range of 'autocomplete' options.
public abstract class Autocomplete : IAutocomplete
Inheritance
Autocomplete
Implements
Derived
Inherited Members
Properties
The full set of all strings that can be suggested.
The key that the user can press to close the currently popped autocomplete menu
The colors to use to render the overlay. Accessing this property before the Application has been initialized will cause an error
The host control to handle.
The maximum number of visible rows in the autocomplete dropdown to render
The maximum width of the autocomplete dropdown
Gets or sets If the popup is displayed inside or outside the host limits.
The key that the user can press to reopen the currently popped autocomplete menu
When more suggestions are available than can be rendered the user can scroll down the dropdown list. This indicates how far down they have gone
The currently selected index into Suggestions that the user has highlighted
The key that the user must press to accept the currently selected autocomplete suggestion
The strings that form the current list of suggestions to render based on what the user has typed so far.
True if the autocomplete should be considered open and visible
Methods
Clears Suggestions
Closes the Autocomplete context menu if it is showing and ClearSuggestions()
Deletes the text backwards before insert the selected text in the HostControl.
Updates SelectedIdx to be a valid index within Suggestions
Populates Suggestions with all strings in AllSuggestions that match with the current cursor position/text in the HostControl
Returns the currently selected word from the HostControl.
When overriding this method views can make use of IdxToWord(List, int, int)
Given a line
of characters, returns the word which ends at idx
or null. Also returns null if the idx
is positioned in the middle of a word.
Use this method to determine whether autocomplete should be shown when the cursor is at a given point in a line and to get the word from which suggestions should be generated. Use the columnOffset
to indicate if search the word at left (negative), at right (positive) or at the current column (zero) which is the default.
Called when the user confirms a selection at the current cursor location in the HostControl. The accepted
string is the full autocomplete word to be inserted. Typically a host will have to remove some characters such that the accepted
string completes the word instead of simply being appended.
Inser the selected text in the HostControl.
Return true if the given symbol should be considered part of a word and can be contained in matches. Base behavior is to use IsLetterOrDigit(char)
Handle mouse events before HostControl e.g. to make mouse events like report/click apply to the autocomplete control instead of changing the cursor position in the underlying text view.
Moves the selection in the Autocomplete context menu down one
Moves the selection in the Autocomplete context menu up one
Handle key events before HostControl e.g. to make key events like up/down apply to the autocomplete control instead of changing the cursor position in the underlying text view.
Renders the autocomplete dialog inside or outside the given HostControl at the given point.
RenderSelectedIdxByMouse(MouseEvent)
Render the current selection in the Autocomplete context menu by the mouse reporting.
Reopen the popup after it has been closed.
Completes the autocomplete selection process. Called when user hits the SelectionKey.