Package org.jline.reader.impl
Class LineReaderImpl.CompletingWord
java.lang.Object
org.jline.reader.impl.LineReaderImpl.CompletingWord
- All Implemented Interfaces:
CompletingParsedLine,ParsedLine
- Enclosing class:
LineReaderImpl
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcursor()The cursor position within the line.escape(CharSequence candidate, boolean complete) Escapes a completion candidate according to the parser's quoting and escaping rules.line()The unparsed line.intReturns the cursor position within the raw (unprocessed) current word.intReturns the length of the raw (unprocessed) current word.word()The current word being completed.intThe cursor position within the current word.intThe index of the current word in the list of words.words()The list of words.
-
Field Details
-
word
-
-
Constructor Details
-
CompletingWord
-
-
Method Details
-
escape
Description copied from interface:CompletingParsedLineEscapes a completion candidate according to the parser's quoting and escaping rules.This method ensures that special characters in the candidate are properly escaped or quoted according to the syntax rules of the parser, maintaining consistency with the current input line's quoting style.
- Specified by:
escapein interfaceCompletingParsedLine- Parameters:
candidate- the completion candidate that may need escapingcomplete- true if this is a complete word, false if it's a partial completion- Returns:
- the properly escaped/quoted candidate ready for insertion
-
rawWordCursor
public int rawWordCursor()Description copied from interface:CompletingParsedLineReturns the cursor position within the raw (unprocessed) current word.Unlike
ParsedLine.wordCursor(), this method returns the cursor position in the original word text, including any quotes and escape characters.- Specified by:
rawWordCursorin interfaceCompletingParsedLine- Returns:
- the cursor position within the raw current word
-
rawWordLength
public int rawWordLength()Description copied from interface:CompletingParsedLineReturns the length of the raw (unprocessed) current word.This is the length of the original word text, including any quotes and escape characters that may have been removed during parsing.
- Specified by:
rawWordLengthin interfaceCompletingParsedLine- Returns:
- the length of the raw current word
-
word
Description copied from interface:ParsedLineThe current word being completed. If the cursor is after the last word, an empty string is returned.- Specified by:
wordin interfaceParsedLine- Returns:
- the word being completed or an empty string
-
wordCursor
public int wordCursor()Description copied from interface:ParsedLineThe cursor position within the current word.- Specified by:
wordCursorin interfaceParsedLine- Returns:
- the cursor position within the current word
-
wordIndex
public int wordIndex()Description copied from interface:ParsedLineThe index of the current word in the list of words.- Specified by:
wordIndexin interfaceParsedLine- Returns:
- the index of the current word in the list of words
-
words
Description copied from interface:ParsedLineThe list of words.- Specified by:
wordsin interfaceParsedLine- Returns:
- the list of words
-
line
Description copied from interface:ParsedLineThe unparsed line.- Specified by:
linein interfaceParsedLine- Returns:
- the unparsed line
-
cursor
public int cursor()Description copied from interface:ParsedLineThe cursor position within the line.- Specified by:
cursorin interfaceParsedLine- Returns:
- the cursor position within the line
-