LLDB mainline
|
Instances of Editline provide an abstraction over libedit's EditLine facility. More...
#include <Editline.h>
Public Member Functions | |
Editline (const char *editor_name, FILE *input_file, FILE *output_file, FILE *error_file, std::recursive_mutex &output_mutex) | |
~Editline () | |
void | SetPrompt (const char *prompt) |
Sets a string to be used as a prompt, or combined with a line number to form a prompt. | |
void | SetContinuationPrompt (const char *continuation_prompt) |
Sets an alternate string to be used as a prompt for the second line and beyond in multi-line editing scenarios. | |
void | TerminalSizeChanged () |
Call when the terminal size changes. | |
const char * | GetPrompt () |
Returns the prompt established by SetPrompt. | |
uint32_t | GetCurrentLine () |
Returns the index of the line currently being edited. | |
bool | Interrupt () |
Interrupt the current edit as if ^C was pressed. | |
bool | Cancel () |
Cancel this edit and obliterate all trace of it. | |
void | SetSuggestionCallback (SuggestionCallbackType callback) |
Register a callback for autosuggestion. | |
void | SetAutoCompleteCallback (CompleteCallbackType callback) |
Register a callback for the tab key. | |
void | SetIsInputCompleteCallback (IsInputCompleteCallbackType callback) |
Register a callback for testing whether multi-line input is complete. | |
void | SetFixIndentationCallback (FixIndentationCallbackType callback, const char *indent_chars) |
Register a callback for determining the appropriate indentation for a line when creating a newline. | |
void | SetPromptAnsiPrefix (std::string prefix) |
void | SetPromptAnsiSuffix (std::string suffix) |
void | SetSuggestionAnsiPrefix (std::string prefix) |
void | SetSuggestionAnsiSuffix (std::string suffix) |
bool | GetLine (std::string &line, bool &interrupted) |
Prompts for and reads a single line of user input. | |
bool | GetLines (int first_line_number, StringList &lines, bool &interrupted) |
Prompts for and reads a multi-line batch of user input. | |
void | PrintAsync (Stream *stream, const char *s, size_t len) |
StringList | GetInputAsStringList (int line_count=UINT32_MAX) |
Convert the current input lines into a UTF8 StringList. | |
size_t | GetTerminalWidth () |
size_t | GetTerminalHeight () |
Static Public Member Functions | |
static Editline * | InstanceFor (::EditLine *editline) |
Uses the user data storage of EditLine to retrieve an associated instance of Editline. | |
static void | DisplayCompletions (Editline &editline, llvm::ArrayRef< CompletionResult::Completion > results) |
Private Member Functions | |
void | SetBaseLineNumber (int line_number) |
Sets the lowest line number for multi-line editing sessions. | |
std::string | PromptForIndex (int line_index) |
Returns the complete prompt by combining the prompt or continuation prompt with line numbers as appropriate. | |
void | SetCurrentLine (int line_index) |
Sets the current line index between line edits to allow free movement between lines. | |
size_t | GetPromptWidth () |
Determines the width of the prompt in characters. | |
bool | IsEmacs () |
Returns true if the underlying EditLine session's keybindings are Emacs-based, or false if they are VI-based. | |
bool | IsOnlySpaces () |
Returns true if the current EditLine buffer contains nothing but spaces, or is empty. | |
int | GetLineIndexForLocation (CursorLocation location, int cursor_row) |
Helper method used by MoveCursor to determine relative line position. | |
void | MoveCursor (CursorLocation from, CursorLocation to) |
Move the cursor from one well-established location to another using relative line positioning and absolute column positioning. | |
void | DisplayInput (int firstIndex=0) |
Clear from cursor position to bottom of screen and print input lines including prompts, optionally starting from a specific line. | |
int | CountRowsForLine (const EditLineStringType &content) |
Counts the number of rows a given line of content will end up occupying, taking into account both the preceding prompt and a single trailing space occupied by a cursor when at the end of the line. | |
void | SaveEditedLine () |
Save the line currently being edited. | |
unsigned char | RecallHistory (HistoryOperation op) |
Replaces the current multi-line session with the next entry from history. | |
int | GetCharacter (EditLineGetCharType *c) |
Character reading implementation for EditLine that supports our multi-line editing trickery. | |
const char * | Prompt () |
Prompt implementation for EditLine. | |
unsigned char | BreakLineCommand (int ch) |
Line break command used when meta+return is pressed in multi-line mode. | |
unsigned char | EndOrAddLineCommand (int ch) |
Command used when return is pressed in multi-line mode. | |
unsigned char | DeleteNextCharCommand (int ch) |
Delete command used when delete is pressed in multi-line mode. | |
unsigned char | DeletePreviousCharCommand (int ch) |
Delete command used when backspace is pressed in multi-line mode. | |
unsigned char | PreviousLineCommand (int ch) |
Line navigation command used when ^P or up arrow are pressed in multi-line mode. | |
unsigned char | NextLineCommand (int ch) |
Line navigation command used when ^N or down arrow are pressed in multi-line mode. | |
unsigned char | PreviousHistoryCommand (int ch) |
History navigation command used when Alt + up arrow is pressed in multi-line mode. | |
unsigned char | NextHistoryCommand (int ch) |
History navigation command used when Alt + down arrow is pressed in multi-line mode. | |
unsigned char | BufferStartCommand (int ch) |
Buffer start command used when Esc < is typed in multi-line emacs mode. | |
unsigned char | BufferEndCommand (int ch) |
Buffer end command used when Esc > is typed in multi-line emacs mode. | |
unsigned char | TabCommand (int ch) |
Context-sensitive tab insertion or code completion command used when the tab key is typed. | |
unsigned char | ApplyAutosuggestCommand (int ch) |
Apply autosuggestion part in gray as editline. | |
unsigned char | TypedCharacter (int ch) |
Command used when a character is typed. | |
unsigned char | FixIndentationCommand (int ch) |
Respond to normal character insertion by fixing line indentation. | |
unsigned char | RevertLineCommand (int ch) |
Revert line command used when moving between lines. | |
void | ConfigureEditor (bool multiline) |
Ensures that the current EditLine instance is properly configured for single or multi-line editing. | |
bool | CompleteCharacter (char ch, EditLineGetCharType &out) |
void | ApplyTerminalSizeChange () |
void | AddFunctionToEditLine (const EditLineCharType *command, const EditLineCharType *helptext, EditlineCommandCallbackType callbackFn) |
void | SetEditLinePromptCallback (EditlinePromptCallbackType callbackFn) |
void | SetGetCharacterFunction (EditlineGetCharCallbackType callbackFn) |
Instances of Editline provide an abstraction over libedit's EditLine facility.
Both single- and multi-line editing are supported.
Definition at line 152 of file Editline.h.
Editline::Editline | ( | const char * | editor_name, |
FILE * | input_file, | ||
FILE * | output_file, | ||
FILE * | error_file, | ||
std::recursive_mutex & | output_mutex | ||
) |
Definition at line 1473 of file Editline.cpp.
References lldb_private::line_editor::EditlineHistory::GetHistory(), m_editor_name, and m_history_sp.
Editline::~Editline | ( | ) |
Definition at line 1485 of file Editline.cpp.
References m_editline, and m_history_sp.
|
private |
Definition at line 1209 of file Editline.cpp.
References el_wset, and m_editline.
Referenced by ConfigureEditor().
|
private |
Apply autosuggestion part in gray as editline.
Definition at line 1155 of file Editline.cpp.
References m_editline, and m_suggestion_callback.
Referenced by ConfigureEditor().
|
private |
Definition at line 1513 of file Editline.cpp.
References el_wline, GetPromptWidth(), LineInfoW, m_current_line_rows, m_editline, m_terminal_height, m_terminal_size_has_changed, and m_terminal_width.
Referenced by ConfigureEditor(), and GetCharacter().
|
private |
Line break command used when meta+return is pressed in multi-line mode.
Definition at line 618 of file Editline.cpp.
References lldb_private::StringList::AppendString(), DisplayInput(), EditLineConstString, el_wline, FixIndentation(), GetIndentation(), GetInputAsStringList(), IsInputPending(), IsOnlySpaces(), LineInfoW, m_current_line_index, m_editline, m_fix_indentation_callback, m_input_file, m_input_lines, m_revert_cursor_index, MoveCursor(), and SetCurrentLine().
Referenced by ConfigureEditor(), and EndOrAddLineCommand().
|
private |
Buffer end command used when Esc > is typed in multi-line emacs mode.
Definition at line 917 of file Editline.cpp.
References m_input_lines, MoveCursor(), SaveEditedLine(), and SetCurrentLine().
Referenced by ConfigureEditor().
|
private |
Buffer start command used when Esc < is typed in multi-line emacs mode.
Definition at line 909 of file Editline.cpp.
References m_revert_cursor_index, MoveCursor(), SaveEditedLine(), and SetCurrentLine().
Referenced by ConfigureEditor().
bool Editline::Cancel | ( | ) |
Cancel this edit and obliterate all trace of it.
Definition at line 1562 of file Editline.cpp.
References ANSI_CLEAR_BELOW, lldb_private::ConnectionFileDescriptor::InterruptRead(), m_editor_status, m_input_connection, m_output_file, m_output_mutex, and MoveCursor().
|
private |
Definition at line 1668 of file Editline.cpp.
References m_input_connection, and lldb_private::ConnectionFileDescriptor::Read().
Referenced by GetCharacter().
|
private |
Ensures that the current EditLine instance is properly configured for single or multi-line editing.
Definition at line 1224 of file Editline.cpp.
References AddFunctionToEditLine(), ApplyAutosuggestCommand(), ApplyTerminalSizeChange(), BreakLineCommand(), BufferEndCommand(), BufferStartCommand(), DeleteNextCharCommand(), DeletePreviousCharCommand(), EditLineConstString, el_wset, EndOrAddLineCommand(), ESCAPE, FixIndentationCommand(), GetCharacter(), InstanceFor(), IsEmacs(), m_editline, m_editor_name, m_error_file, m_fix_indentation_callback, m_fix_indentation_callback_chars, m_history_sp, m_input_file, m_multiline_enabled, m_output_file, m_suggestion_callback, NextHistoryCommand(), NextLineCommand(), PreviousHistoryCommand(), PreviousLineCommand(), Prompt(), RevertLineCommand(), SetEditLinePromptCallback(), SetGetCharacterFunction(), TabCommand(), and TypedCharacter().
Referenced by GetLine(), and GetLines().
|
private |
Counts the number of rows a given line of content will end up occupying, taking into account both the preceding prompt and a single trailing space occupied by a cursor when at the end of the line.
Definition at line 428 of file Editline.cpp.
References ColumnWidth(), m_terminal_width, and PromptForIndex().
Referenced by DeletePreviousCharCommand(), GetLineIndexForLocation(), and PreviousLineCommand().
|
private |
Delete command used when delete is pressed in multi-line mode.
Definition at line 706 of file Editline.cpp.
References DisplayInput(), el_winsertstr, el_wline, LineInfoW, m_current_line_index, m_editline, m_editor_status, m_input_lines, m_output_file, MoveCursor(), and SaveEditedLine().
Referenced by ConfigureEditor().
|
private |
Delete command used when backspace is pressed in multi-line mode.
Definition at line 745 of file Editline.cpp.
References ANSI_SET_COLUMN_N, ANSI_UP_N_ROWS, CountRowsForLine(), DisplayInput(), el_winsertstr, el_wline, LineInfoW, m_current_line_index, m_editline, m_input_lines, m_output_file, MoveCursor(), SaveEditedLine(), and SetCurrentLine().
Referenced by ConfigureEditor().
|
static |
Account for the current line, the line showing "Available completions" before and the line saying "More" after.
Definition at line 1028 of file Editline.cpp.
References ANSI_CLEAR_BELOW, el_wgetc, GetTerminalHeight(), GetTerminalWidth(), m_editline, m_editor_status, m_output_file, and PrintCompletion().
Referenced by TabCommand().
|
private |
Clear from cursor position to bottom of screen and print input lines including prompts, optionally starting from a specific line.
Lines are drawn with an extra space at the end to reserve room for the rightmost cursor position.
Definition at line 413 of file Editline.cpp.
References ANSI_CLEAR_BELOW, ANSI_SET_COLUMN_N, EditLineStringFormatSpec, m_input_lines, m_output_file, m_prompt_ansi_prefix, m_prompt_ansi_suffix, and PromptForIndex().
Referenced by BreakLineCommand(), DeleteNextCharCommand(), DeletePreviousCharCommand(), FixIndentationCommand(), GetCharacter(), GetLines(), PrintAsync(), RecallHistory(), and TabCommand().
|
private |
Command used when return is pressed in multi-line mode.
Definition at line 666 of file Editline.cpp.
References BreakLineCommand(), el_wline, GetInputAsStringList(), IsInputPending(), LineInfoW, m_current_line_index, m_editline, m_editor_status, m_input_file, m_input_lines, m_is_input_complete_callback, m_output_file, MoveCursor(), and SaveEditedLine().
Referenced by ConfigureEditor().
|
private |
Respond to normal character insertion by fixing line indentation.
Definition at line 849 of file Editline.cpp.
References DisplayInput(), el_winsertstr, el_wline, GetInputAsStringList(), lldb_private::StringList::GetStringAtIndex(), LineInfoW, m_current_line_index, m_editline, m_fix_indentation_callback, m_input_lines, m_revert_cursor_index, MoveCursor(), SaveEditedLine(), and SetCurrentLine().
Referenced by ConfigureEditor().
|
private |
Character reading implementation for EditLine that supports our multi-line editing trickery.
Definition at line 530 of file Editline.cpp.
References ApplyTerminalSizeChange(), CompleteCharacter(), DisplayInput(), lldb::eConnectionStatusEndOfFile, lldb::eConnectionStatusError, lldb::eConnectionStatusInterrupted, lldb::eConnectionStatusLostConnection, lldb::eConnectionStatusNoConnection, lldb::eConnectionStatusSuccess, lldb::eConnectionStatusTimedOut, el_wline, GetPromptWidth(), LineInfoW, lldbassert, m_current_line_index, m_current_line_rows, m_editline, m_editor_status, m_input_connection, m_multiline_enabled, m_needs_prompt_repaint, m_output_file, m_output_mutex, m_prompt_ansi_prefix, m_prompt_ansi_suffix, m_terminal_size_has_changed, m_terminal_width, MoveCursor(), Prompt(), lldb_private::ConnectionFileDescriptor::Read(), and SaveEditedLine().
Referenced by ConfigureEditor().
uint32_t Editline::GetCurrentLine | ( | ) |
Returns the index of the line currently being edited.
Definition at line 1549 of file Editline.cpp.
References m_current_line_index.
StringList Editline::GetInputAsStringList | ( | int | line_count = UINT32_MAX | ) |
Convert the current input lines into a UTF8 StringList.
Definition at line 441 of file Editline.cpp.
References lldb_private::StringList::AppendString(), and m_input_lines.
Referenced by BreakLineCommand(), EndOrAddLineCommand(), FixIndentationCommand(), GetLines(), and NextLineCommand().
bool Editline::GetLine | ( | std::string & | line, |
bool & | interrupted | ||
) |
Prompts for and reads a single line of user input.
Definition at line 1574 of file Editline.cpp.
References ConfigureEditor(), EditLineConstString, el_wgets, lldbassert, m_editline, m_editor_status, m_history_sp, m_in_history, m_input_lines, m_output_file, m_output_mutex, m_revert_cursor_index, SetCurrentLine(), and SplitLines().
|
private |
Helper method used by MoveCursor to determine relative line position.
Definition at line 363 of file Editline.cpp.
References CountRowsForLine(), m_current_line_index, and m_input_lines.
Referenced by MoveCursor().
bool Editline::GetLines | ( | int | first_line_number, |
StringList & | lines, | ||
bool & | interrupted | ||
) |
Prompts for and reads a multi-line batch of user input.
Definition at line 1614 of file Editline.cpp.
References CombineLines(), ConfigureEditor(), DisplayInput(), EditLineConstString, el_wgets, el_wpush, GetInputAsStringList(), m_current_line_rows, m_editline, m_editor_status, m_history_sp, m_in_history, m_input_lines, m_output_mutex, m_revert_cursor_index, MoveCursor(), SetBaseLineNumber(), and SetCurrentLine().
const char * Editline::GetPrompt | ( | ) |
Returns the prompt established by SetPrompt.
Definition at line 1547 of file Editline.cpp.
References m_set_prompt.
|
private |
Determines the width of the prompt in characters.
The width is guaranteed to be the same for all lines of the current multi-line session.
Definition at line 345 of file Editline.cpp.
References ColumnWidth(), and PromptForIndex().
Referenced by ApplyTerminalSizeChange(), GetCharacter(), MoveCursor(), NextLineCommand(), and TypedCharacter().
|
inline |
Definition at line 243 of file Editline.h.
References m_terminal_height.
Referenced by DisplayCompletions().
|
inline |
Definition at line 241 of file Editline.h.
References m_terminal_width.
Referenced by DisplayCompletions().
|
static |
Uses the user data storage of EditLine to retrieve an associated instance of Editline.
Definition at line 1467 of file Editline.cpp.
Referenced by ConfigureEditor().
bool Editline::Interrupt | ( | ) |
Interrupt the current edit as if ^C was pressed.
Definition at line 1551 of file Editline.cpp.
References lldb_private::ConnectionFileDescriptor::InterruptRead(), m_editor_status, m_input_connection, m_output_file, and m_output_mutex.
|
private |
Returns true if the underlying EditLine session's keybindings are Emacs-based, or false if they are VI-based.
Definition at line 347 of file Editline.cpp.
References m_editline.
Referenced by ConfigureEditor().
|
private |
Returns true if the current EditLine buffer contains nothing but spaces, or is empty.
Definition at line 353 of file Editline.cpp.
References el_wline, LineInfoW, and m_editline.
Referenced by BreakLineCommand(), NextLineCommand(), and PreviousLineCommand().
|
private |
Move the cursor from one well-established location to another using relative line positioning and absolute column positioning.
Definition at line 384 of file Editline.cpp.
References ANSI_DOWN_N_ROWS, ANSI_SET_COLUMN_N, ANSI_UP_N_ROWS, el_wline, GetLineIndexForLocation(), GetPromptWidth(), LineInfoW, m_editline, m_input_lines, m_output_file, and m_terminal_width.
Referenced by BreakLineCommand(), BufferEndCommand(), BufferStartCommand(), Cancel(), DeleteNextCharCommand(), DeletePreviousCharCommand(), EndOrAddLineCommand(), FixIndentationCommand(), GetCharacter(), GetLines(), PreviousLineCommand(), PrintAsync(), RecallHistory(), and TabCommand().
|
private |
History navigation command used when Alt + down arrow is pressed in multi-line mode.
Definition at line 843 of file Editline.cpp.
References RecallHistory(), and SaveEditedLine().
Referenced by ConfigureEditor().
|
private |
Line navigation command used when ^N or down arrow are pressed in multi-line mode.
Definition at line 801 of file Editline.cpp.
References lldb_private::StringList::AppendString(), el_wline, GetInputAsStringList(), GetPromptWidth(), IsOnlySpaces(), LineInfoW, m_current_line_index, m_current_line_rows, m_editline, m_fix_indentation_callback, m_input_lines, m_output_file, m_terminal_width, RecallHistory(), SaveEditedLine(), and SetCurrentLine().
Referenced by ConfigureEditor().
|
private |
History navigation command used when Alt + up arrow is pressed in multi-line mode.
Definition at line 837 of file Editline.cpp.
References RecallHistory(), and SaveEditedLine().
Referenced by ConfigureEditor().
|
private |
Line navigation command used when ^P or up arrow are pressed in multi-line mode.
Definition at line 779 of file Editline.cpp.
References ANSI_CLEAR_BELOW, ANSI_SET_COLUMN_N, ANSI_UP_N_ROWS, CountRowsForLine(), IsOnlySpaces(), m_current_line_index, m_input_lines, m_output_file, MoveCursor(), RecallHistory(), SaveEditedLine(), and SetCurrentLine().
Referenced by ConfigureEditor().
void Editline::PrintAsync | ( | Stream * | stream, |
const char * | s, | ||
size_t | len | ||
) |
Definition at line 1653 of file Editline.cpp.
References ANSI_CLEAR_BELOW, DisplayInput(), lldb_private::Stream::Flush(), m_editor_status, m_output_file, m_output_mutex, MoveCursor(), SaveEditedLine(), and lldb_private::Stream::Write().
|
private |
Prompt implementation for EditLine.
Definition at line 612 of file Editline.cpp.
References m_current_prompt, m_needs_prompt_repaint, m_prompt_ansi_prefix, and m_prompt_ansi_suffix.
Referenced by ConfigureEditor(), and GetCharacter().
|
private |
Returns the complete prompt by combining the prompt or continuation prompt with line numbers as appropriate.
The line index is a zero-based index into the current multi-line session.
Definition at line 310 of file Editline.cpp.
References ColumnWidth(), lldb_private::StreamString::GetString(), m_base_line_number, m_line_number_digits, m_multiline_enabled, m_set_continuation_prompt, m_set_prompt, and lldb_private::Stream::Printf().
Referenced by CountRowsForLine(), DisplayInput(), GetPromptWidth(), and SetCurrentLine().
|
private |
Replaces the current multi-line session with the next entry from history.
Definition at line 458 of file Editline.cpp.
References DisplayInput(), GetOperation(), HistEventW, history_w, HistoryW, m_current_line_index, m_history_sp, m_in_history, m_input_lines, m_live_history_lines, MoveCursor(), SaveEditedLine(), SetCurrentLine(), and SplitLines().
Referenced by NextHistoryCommand(), NextLineCommand(), PreviousHistoryCommand(), and PreviousLineCommand().
|
private |
Revert line command used when moving between lines.
Definition at line 896 of file Editline.cpp.
References el_winsertstr, el_wline, LineInfoW, m_current_line_index, m_editline, m_input_lines, and m_revert_cursor_index.
Referenced by ConfigureEditor().
|
private |
Save the line currently being edited.
Definition at line 435 of file Editline.cpp.
References el_wline, LineInfoW, m_current_line_index, m_editline, and m_input_lines.
Referenced by BufferEndCommand(), BufferStartCommand(), DeleteNextCharCommand(), DeletePreviousCharCommand(), EndOrAddLineCommand(), FixIndentationCommand(), GetCharacter(), NextHistoryCommand(), NextLineCommand(), PreviousHistoryCommand(), PreviousLineCommand(), PrintAsync(), and RecallHistory().
|
inline |
Register a callback for the tab key.
Definition at line 196 of file Editline.h.
References m_completion_callback.
|
private |
Sets the lowest line number for multi-line editing sessions.
A value of zero suppresses line number printing in the prompt.
Definition at line 304 of file Editline.cpp.
References m_base_line_number, and m_line_number_digits.
Referenced by GetLines().
void Editline::SetContinuationPrompt | ( | const char * | continuation_prompt | ) |
Sets an alternate string to be used as a prompt for the second line and beyond in multi-line editing scenarios.
Definition at line 1506 of file Editline.cpp.
References m_set_continuation_prompt.
|
private |
Sets the current line index between line edits to allow free movement between lines.
Updates the prompt to match.
Definition at line 340 of file Editline.cpp.
References m_current_line_index, m_current_prompt, and PromptForIndex().
Referenced by BreakLineCommand(), BufferEndCommand(), BufferStartCommand(), DeletePreviousCharCommand(), FixIndentationCommand(), GetLine(), GetLines(), NextLineCommand(), PreviousLineCommand(), and RecallHistory().
|
private |
Definition at line 1215 of file Editline.cpp.
References m_editline.
Referenced by ConfigureEditor().
|
inline |
Register a callback for determining the appropriate indentation for a line when creating a newline.
An optional set of insertable characters can also trigger the callback.
Definition at line 208 of file Editline.h.
References m_fix_indentation_callback, and m_fix_indentation_callback_chars.
|
private |
Definition at line 1220 of file Editline.cpp.
References el_wset, and m_editline.
Referenced by ConfigureEditor().
|
inline |
Register a callback for testing whether multi-line input is complete.
Definition at line 201 of file Editline.h.
References m_is_input_complete_callback.
void Editline::SetPrompt | ( | const char * | prompt | ) |
Sets a string to be used as a prompt, or combined with a line number to form a prompt.
Definition at line 1502 of file Editline.cpp.
References m_set_prompt.
|
inline |
Definition at line 214 of file Editline.h.
References m_prompt_ansi_prefix.
|
inline |
Definition at line 218 of file Editline.h.
References m_prompt_ansi_suffix.
|
inline |
Definition at line 222 of file Editline.h.
References m_suggestion_ansi_prefix.
|
inline |
Definition at line 226 of file Editline.h.
References m_suggestion_ansi_suffix.
|
inline |
Register a callback for autosuggestion.
Definition at line 191 of file Editline.h.
References m_suggestion_callback.
|
private |
Context-sensitive tab insertion or code completion command used when the tab key is typed.
Definition at line 1082 of file Editline.cpp.
References DisplayCompletions(), DisplayInput(), lldb_private::Args::empty(), lldb_private::CompletionResult::Completion::GetCompletion(), lldb_private::CompletionRequest::GetCursorArgumentPrefix(), lldb_private::CompletionRequest::GetCursorIndex(), lldb_private::CompletionResult::GetMatches(), lldb_private::CompletionResult::Completion::GetMode(), lldb_private::CompletionRequest::GetParsedArg(), lldb_private::CompletionRequest::GetParsedLine(), lldb_private::Args::ArgEntry::GetQuoteChar(), lldb_private::CompletionResult::GetResults(), lldb_private::Args::ArgEntry::IsQuoted(), lldb_private::StringList::LongestCommonPrefix(), m_completion_callback, m_editline, MoveCursor(), lldb_private::Normal, lldb_private::Partial, lldb_private::RewriteLine, and lldb_private::Args::size().
Referenced by ConfigureEditor().
void Editline::TerminalSizeChanged | ( | ) |
Call when the terminal size changes.
Definition at line 1511 of file Editline.cpp.
References m_terminal_size_has_changed.
|
private |
Command used when a character is typed.
Definition at line 1170 of file Editline.cpp.
References ANSI_SET_COLUMN_N, GetPromptWidth(), m_editline, m_output_file, m_previous_autosuggestion_size, m_suggestion_ansi_prefix, m_suggestion_ansi_suffix, m_suggestion_callback, and m_terminal_width.
Referenced by ConfigureEditor().
|
private |
Definition at line 379 of file Editline.h.
Referenced by PromptForIndex(), and SetBaseLineNumber().
|
private |
Definition at line 400 of file Editline.h.
Referenced by SetAutoCompleteCallback(), and TabCommand().
|
private |
Definition at line 380 of file Editline.h.
Referenced by BreakLineCommand(), DeleteNextCharCommand(), DeletePreviousCharCommand(), EndOrAddLineCommand(), FixIndentationCommand(), GetCharacter(), GetCurrentLine(), GetLineIndexForLocation(), NextLineCommand(), PreviousLineCommand(), RecallHistory(), RevertLineCommand(), SaveEditedLine(), and SetCurrentLine().
|
private |
Definition at line 381 of file Editline.h.
Referenced by ApplyTerminalSizeChange(), GetCharacter(), GetLines(), and NextLineCommand().
|
private |
Definition at line 386 of file Editline.h.
Referenced by Prompt(), and SetCurrentLine().
|
private |
Definition at line 370 of file Editline.h.
Referenced by AddFunctionToEditLine(), ApplyAutosuggestCommand(), ApplyTerminalSizeChange(), BreakLineCommand(), ConfigureEditor(), DeleteNextCharCommand(), DeletePreviousCharCommand(), DisplayCompletions(), EndOrAddLineCommand(), FixIndentationCommand(), GetCharacter(), GetLine(), GetLines(), IsEmacs(), IsOnlySpaces(), MoveCursor(), NextLineCommand(), RevertLineCommand(), SaveEditedLine(), SetEditLinePromptCallback(), SetGetCharacterFunction(), TabCommand(), TypedCharacter(), and ~Editline().
|
private |
Definition at line 389 of file Editline.h.
Referenced by ConfigureEditor(), and Editline().
|
private |
Definition at line 376 of file Editline.h.
Referenced by Cancel(), DeleteNextCharCommand(), DisplayCompletions(), EndOrAddLineCommand(), GetCharacter(), GetLine(), GetLines(), Interrupt(), and PrintAsync().
|
private |
Definition at line 392 of file Editline.h.
Referenced by ConfigureEditor().
|
private |
Definition at line 397 of file Editline.h.
Referenced by BreakLineCommand(), ConfigureEditor(), FixIndentationCommand(), NextLineCommand(), and SetFixIndentationCallback().
|
private |
Definition at line 398 of file Editline.h.
Referenced by ConfigureEditor(), and SetFixIndentationCallback().
|
private |
Definition at line 371 of file Editline.h.
Referenced by ConfigureEditor(), Editline(), GetLine(), GetLines(), RecallHistory(), and ~Editline().
|
private |
Definition at line 372 of file Editline.h.
Referenced by GetLine(), GetLines(), and RecallHistory().
|
private |
Definition at line 393 of file Editline.h.
Referenced by Cancel(), CompleteCharacter(), GetCharacter(), and Interrupt().
|
private |
Definition at line 390 of file Editline.h.
Referenced by BreakLineCommand(), ConfigureEditor(), and EndOrAddLineCommand().
|
private |
Definition at line 375 of file Editline.h.
Referenced by BreakLineCommand(), BufferEndCommand(), DeleteNextCharCommand(), DeletePreviousCharCommand(), DisplayInput(), EndOrAddLineCommand(), FixIndentationCommand(), GetInputAsStringList(), GetLine(), GetLineIndexForLocation(), GetLines(), MoveCursor(), NextLineCommand(), PreviousLineCommand(), RecallHistory(), RevertLineCommand(), and SaveEditedLine().
|
private |
Definition at line 395 of file Editline.h.
Referenced by EndOrAddLineCommand(), and SetIsInputCompleteCallback().
|
private |
Definition at line 383 of file Editline.h.
Referenced by PromptForIndex(), and SetBaseLineNumber().
|
private |
Definition at line 373 of file Editline.h.
Referenced by RecallHistory().
|
private |
Definition at line 374 of file Editline.h.
Referenced by ConfigureEditor(), GetCharacter(), and PromptForIndex().
|
private |
Definition at line 387 of file Editline.h.
Referenced by GetCharacter(), and Prompt().
|
private |
Definition at line 391 of file Editline.h.
Referenced by Cancel(), ConfigureEditor(), DeleteNextCharCommand(), DeletePreviousCharCommand(), DisplayCompletions(), DisplayInput(), EndOrAddLineCommand(), GetCharacter(), GetLine(), Interrupt(), MoveCursor(), NextLineCommand(), PreviousLineCommand(), PrintAsync(), and TypedCharacter().
|
private |
Definition at line 409 of file Editline.h.
Referenced by Cancel(), GetCharacter(), GetLine(), GetLines(), Interrupt(), and PrintAsync().
|
private |
Definition at line 408 of file Editline.h.
Referenced by TypedCharacter().
|
private |
Definition at line 403 of file Editline.h.
Referenced by DisplayInput(), GetCharacter(), Prompt(), and SetPromptAnsiPrefix().
|
private |
Definition at line 404 of file Editline.h.
Referenced by DisplayInput(), GetCharacter(), Prompt(), and SetPromptAnsiSuffix().
|
private |
Definition at line 382 of file Editline.h.
Referenced by BreakLineCommand(), BufferStartCommand(), FixIndentationCommand(), GetLine(), GetLines(), and RevertLineCommand().
|
private |
Definition at line 385 of file Editline.h.
Referenced by PromptForIndex(), and SetContinuationPrompt().
|
private |
Definition at line 384 of file Editline.h.
Referenced by GetPrompt(), PromptForIndex(), and SetPrompt().
|
private |
Definition at line 405 of file Editline.h.
Referenced by SetSuggestionAnsiPrefix(), and TypedCharacter().
|
private |
Definition at line 406 of file Editline.h.
Referenced by SetSuggestionAnsiSuffix(), and TypedCharacter().
|
private |
Definition at line 401 of file Editline.h.
Referenced by ApplyAutosuggestCommand(), ConfigureEditor(), SetSuggestionCallback(), and TypedCharacter().
|
private |
Definition at line 378 of file Editline.h.
Referenced by ApplyTerminalSizeChange(), and GetTerminalHeight().
|
private |
Definition at line 388 of file Editline.h.
Referenced by ApplyTerminalSizeChange(), GetCharacter(), and TerminalSizeChanged().
|
private |
Definition at line 377 of file Editline.h.
Referenced by ApplyTerminalSizeChange(), CountRowsForLine(), GetCharacter(), GetTerminalWidth(), MoveCursor(), NextLineCommand(), and TypedCharacter().