Skip to content

Commit c3b3942

Browse files
committed
[lldb] Improve comments in Editline.h (NFC)
Fix typos, add missing periods and reflow comments in the Editline header.
1 parent 9ef15f4 commit c3b3942

File tree

1 file changed

+29
-38
lines changed

1 file changed

+29
-38
lines changed

lldb/include/lldb/Host/Editline.h

Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -103,36 +103,36 @@ using SuggestionCallbackType =
103103
using CompleteCallbackType = llvm::unique_function<void(CompletionRequest &)>;
104104

105105
/// Status used to decide when and how to start editing another line in
106-
/// multi-line sessions
106+
/// multi-line sessions.
107107
enum class EditorStatus {
108108

109-
/// The default state proceeds to edit the current line
109+
/// The default state proceeds to edit the current line.
110110
Editing,
111111

112-
/// Editing complete, returns the complete set of edited lines
112+
/// Editing complete, returns the complete set of edited lines.
113113
Complete,
114114

115-
/// End of input reported
115+
/// End of input reported.
116116
EndOfInput,
117117

118-
/// Editing interrupted
118+
/// Editing interrupted.
119119
Interrupted
120120
};
121121

122-
/// Established locations that can be easily moved among with MoveCursor
122+
/// Established locations that can be easily moved among with MoveCursor.
123123
enum class CursorLocation {
124-
/// The start of the first line in a multi-line edit session
124+
/// The start of the first line in a multi-line edit session.
125125
BlockStart,
126126

127-
/// The start of the current line in a multi-line edit session
127+
/// The start of the current line in a multi-line edit session.
128128
EditingPrompt,
129129

130130
/// The location of the cursor on the current line in a multi-line edit
131-
/// session
131+
/// session.
132132
EditingCursor,
133133

134134
/// The location immediately after the last character in a multi-line edit
135-
/// session
135+
/// session.
136136
BlockEnd
137137
};
138138

@@ -149,8 +149,7 @@ enum class HistoryOperation {
149149
using namespace line_editor;
150150

151151
/// Instances of Editline provide an abstraction over libedit's EditLine
152-
/// facility. Both
153-
/// single- and multi-line editing are supported.
152+
/// facility. Both single- and multi-line editing are supported.
154153
class Editline {
155154
public:
156155
Editline(const char *editor_name, FILE *input_file, FILE *output_file,
@@ -168,23 +167,22 @@ class Editline {
168167
void SetPrompt(const char *prompt);
169168

170169
/// Sets an alternate string to be used as a prompt for the second line and
171-
/// beyond in multi-line
172-
/// editing scenarios.
170+
/// beyond in multi-line editing scenarios.
173171
void SetContinuationPrompt(const char *continuation_prompt);
174172

175-
/// Call when the terminal size changes
173+
/// Call when the terminal size changes.
176174
void TerminalSizeChanged();
177175

178-
/// Returns the prompt established by SetPrompt()
176+
/// Returns the prompt established by SetPrompt.
179177
const char *GetPrompt();
180178

181-
/// Returns the index of the line currently being edited
179+
/// Returns the index of the line currently being edited.
182180
uint32_t GetCurrentLine();
183181

184-
/// Interrupt the current edit as if ^C was pressed
182+
/// Interrupt the current edit as if ^C was pressed.
185183
bool Interrupt();
186184

187-
/// Cancel this edit and oblitarate all trace of it
185+
/// Cancel this edit and obliterate all trace of it.
188186
bool Cancel();
189187

190188
/// Register a callback for autosuggestion.
@@ -240,28 +238,24 @@ class Editline {
240238

241239
private:
242240
/// Sets the lowest line number for multi-line editing sessions. A value of
243-
/// zero suppresses
244-
/// line number printing in the prompt.
241+
/// zero suppresses line number printing in the prompt.
245242
void SetBaseLineNumber(int line_number);
246243

247244
/// Returns the complete prompt by combining the prompt or continuation prompt
248-
/// with line numbers
249-
/// as appropriate. The line index is a zero-based index into the current
250-
/// multi-line session.
245+
/// with line numbers as appropriate. The line index is a zero-based index
246+
/// into the current multi-line session.
251247
std::string PromptForIndex(int line_index);
252248

253249
/// Sets the current line index between line edits to allow free movement
254-
/// between lines. Updates
255-
/// the prompt to match.
250+
/// between lines. Updates the prompt to match.
256251
void SetCurrentLine(int line_index);
257252

258253
/// Determines the width of the prompt in characters. The width is guaranteed
259254
/// to be the same for all lines of the current multi-line session.
260255
size_t GetPromptWidth();
261256

262257
/// Returns true if the underlying EditLine session's keybindings are
263-
/// Emacs-based, or false if
264-
/// they are VI-based.
258+
/// Emacs-based, or false if they are VI-based.
265259
bool IsEmacs();
266260

267261
/// Returns true if the current EditLine buffer contains nothing but spaces,
@@ -272,24 +266,21 @@ class Editline {
272266
int GetLineIndexForLocation(CursorLocation location, int cursor_row);
273267

274268
/// Move the cursor from one well-established location to another using
275-
/// relative line positioning
276-
/// and absolute column positioning.
269+
/// relative line positioning and absolute column positioning.
277270
void MoveCursor(CursorLocation from, CursorLocation to);
278271

279272
/// Clear from cursor position to bottom of screen and print input lines
280-
/// including prompts, optionally
281-
/// starting from a specific line. Lines are drawn with an extra space at the
282-
/// end to reserve room for
283-
/// the rightmost cursor position.
273+
/// including prompts, optionally starting from a specific line. Lines are
274+
/// drawn with an extra space at the end to reserve room for the rightmost
275+
/// cursor position.
284276
void DisplayInput(int firstIndex = 0);
285277

286278
/// Counts the number of rows a given line of content will end up occupying,
287-
/// taking into account both
288-
/// the preceding prompt and a single trailing space occupied by a cursor when
289-
/// at the end of the line.
279+
/// taking into account both the preceding prompt and a single trailing space
280+
/// occupied by a cursor when at the end of the line.
290281
int CountRowsForLine(const EditLineStringType &content);
291282

292-
/// Save the line currently being edited
283+
/// Save the line currently being edited.
293284
void SaveEditedLine();
294285

295286
/// Replaces the current multi-line session with the next entry from history.

0 commit comments

Comments
 (0)