Package org.jline.builtins
Class Less
- java.lang.Object
-
- org.jline.builtins.Less
-
public class Less extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
Less.InterruptibleInputStream
private class
Less.LineEditor
protected static class
Less.Operation
(package private) static class
Less.Pair<U,V>
private class
Less.SavedSourcePositions
-
Field Summary
Fields Modifier and Type Field Description protected BindingReader
bindingReader
protected java.lang.StringBuilder
buffer
boolean
chopLongLines
protected java.nio.file.Path
currentDir
protected Display
display
protected java.lang.String
displayPattern
protected java.lang.String
errorMessage
private static int
ESCAPE
protected int
firstColumnToDisplay
protected int
firstLineInMemory
protected int
firstLineToDisplay
protected int
halfWindow
private boolean
highlight
private java.lang.String
historyLog
boolean
ignoreCaseAlways
boolean
ignoreCaseCond
protected KeyMap<Less.Operation>
keys
protected java.util.List<AttributedString>
lines
protected java.lang.String
message
private static java.lang.String
MESSAGE_FILE_INFO
private boolean
nanorcIgnoreErrors
protected int
nbEof
boolean
noInit
boolean
noKeypad
protected int
offsetInLine
protected java.util.Map<java.lang.String,Less.Operation>
options
protected java.lang.String
pattern
protected Nano.PatternHistory
patternHistory
boolean
printLineNumbers
boolean
quiet
boolean
quitAtFirstEof
boolean
quitAtSecondEof
boolean
quitIfOneScreen
protected java.io.BufferedReader
reader
protected Size
size
protected int
sourceIdx
protected java.util.List<Source>
sources
private java.util.List<java.nio.file.Path>
syntaxFiles
(package private) Nano.SyntaxHighlighter
syntaxHighlighter
protected java.lang.String
syntaxName
protected java.util.List<java.lang.Integer>
tabs
protected Terminal
terminal
boolean
veryQuiet
protected int
window
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addFile()
private void
addSource(java.lang.String file)
private void
bindKeys(KeyMap<Less.Operation> map)
private void
bof()
static void
checkInterrupted()
This is for long running commands to be interrupted by ctrl-c(package private) boolean
display(boolean oneScreen)
(package private) boolean
display(boolean oneScreen, java.lang.Integer curPos)
private void
doTabs(java.lang.String val)
private void
eof()
(package private) AttributedString
getLine(int line)
private java.util.regex.Pattern
getPattern()
private java.util.regex.Pattern
getPattern(boolean doDisplayPattern)
(package private) int
getStrictPositiveNumberInBuffer(int def)
void
handle(Terminal.Signal signal)
private void
help()
(package private) void
moveBackward(int lines)
(package private) void
moveForward(int lines)
(package private) void
moveTo(int lineNum)
private void
moveToMatch(boolean forward, boolean spanFiles)
private void
moveToNextMatch()
private void
moveToNextMatch(boolean spanFiles)
private void
moveToPreviousMatch()
private void
moveToPreviousMatch(boolean spanFiles)
private Less.Pair<java.lang.Integer,AttributedString>
nextLine2display(int line, java.util.regex.Pattern dpCompiled)
protected void
openSource()
private void
parseConfig(java.nio.file.Path file)
private Less.Pair<java.lang.Integer,AttributedString>
prevLine2display(int line, java.util.regex.Pattern dpCompiled)
private java.lang.String
printable(java.lang.String s)
void
run(java.util.List<Source> sources)
void
run(Source... sources)
private boolean
search()
Less
tabs(java.util.List<java.lang.Integer> tabs)
private boolean
toBeDisplayed(AttributedString curLine, java.util.regex.Pattern dpCompiled)
static java.lang.String[]
usage()
-
-
-
Field Detail
-
ESCAPE
private static final int ESCAPE
- See Also:
- Constant Field Values
-
MESSAGE_FILE_INFO
private static final java.lang.String MESSAGE_FILE_INFO
- See Also:
- Constant Field Values
-
quitAtSecondEof
public boolean quitAtSecondEof
-
quitAtFirstEof
public boolean quitAtFirstEof
-
quitIfOneScreen
public boolean quitIfOneScreen
-
printLineNumbers
public boolean printLineNumbers
-
quiet
public boolean quiet
-
veryQuiet
public boolean veryQuiet
-
chopLongLines
public boolean chopLongLines
-
ignoreCaseCond
public boolean ignoreCaseCond
-
ignoreCaseAlways
public boolean ignoreCaseAlways
-
noKeypad
public boolean noKeypad
-
noInit
public boolean noInit
-
tabs
protected java.util.List<java.lang.Integer> tabs
-
syntaxName
protected java.lang.String syntaxName
-
historyLog
private java.lang.String historyLog
-
terminal
protected final Terminal terminal
-
display
protected final Display display
-
bindingReader
protected final BindingReader bindingReader
-
currentDir
protected final java.nio.file.Path currentDir
-
sources
protected java.util.List<Source> sources
-
sourceIdx
protected int sourceIdx
-
reader
protected java.io.BufferedReader reader
-
keys
protected KeyMap<Less.Operation> keys
-
firstLineInMemory
protected int firstLineInMemory
-
lines
protected java.util.List<AttributedString> lines
-
firstLineToDisplay
protected int firstLineToDisplay
-
firstColumnToDisplay
protected int firstColumnToDisplay
-
offsetInLine
protected int offsetInLine
-
message
protected java.lang.String message
-
errorMessage
protected java.lang.String errorMessage
-
buffer
protected final java.lang.StringBuilder buffer
-
options
protected final java.util.Map<java.lang.String,Less.Operation> options
-
window
protected int window
-
halfWindow
protected int halfWindow
-
nbEof
protected int nbEof
-
patternHistory
protected Nano.PatternHistory patternHistory
-
pattern
protected java.lang.String pattern
-
displayPattern
protected java.lang.String displayPattern
-
size
protected final Size size
-
syntaxHighlighter
Nano.SyntaxHighlighter syntaxHighlighter
-
syntaxFiles
private final java.util.List<java.nio.file.Path> syntaxFiles
-
highlight
private boolean highlight
-
nanorcIgnoreErrors
private boolean nanorcIgnoreErrors
-
-
Method Detail
-
usage
public static java.lang.String[] usage()
-
parseConfig
private void parseConfig(java.nio.file.Path file) throws java.io.IOException
- Throws:
java.io.IOException
-
doTabs
private void doTabs(java.lang.String val)
-
tabs
public Less tabs(java.util.List<java.lang.Integer> tabs)
-
handle
public void handle(Terminal.Signal signal)
-
run
public void run(Source... sources) throws java.io.IOException, java.lang.InterruptedException
- Throws:
java.io.IOException
java.lang.InterruptedException
-
run
public void run(java.util.List<Source> sources) throws java.io.IOException, java.lang.InterruptedException
- Throws:
java.io.IOException
java.lang.InterruptedException
-
moveToMatch
private void moveToMatch(boolean forward, boolean spanFiles) throws java.io.IOException
- Throws:
java.io.IOException
-
addSource
private void addSource(java.lang.String file) throws java.io.IOException
- Throws:
java.io.IOException
-
addFile
private void addFile() throws java.io.IOException, java.lang.InterruptedException
- Throws:
java.io.IOException
java.lang.InterruptedException
-
search
private boolean search() throws java.io.IOException, java.lang.InterruptedException
- Throws:
java.io.IOException
java.lang.InterruptedException
-
help
private void help() throws java.io.IOException
- Throws:
java.io.IOException
-
openSource
protected void openSource() throws java.io.IOException
- Throws:
java.io.IOException
-
moveTo
void moveTo(int lineNum) throws java.io.IOException
- Throws:
java.io.IOException
-
moveToNextMatch
private void moveToNextMatch() throws java.io.IOException
- Throws:
java.io.IOException
-
moveToNextMatch
private void moveToNextMatch(boolean spanFiles) throws java.io.IOException
- Throws:
java.io.IOException
-
moveToPreviousMatch
private void moveToPreviousMatch() throws java.io.IOException
- Throws:
java.io.IOException
-
moveToPreviousMatch
private void moveToPreviousMatch(boolean spanFiles) throws java.io.IOException
- Throws:
java.io.IOException
-
printable
private java.lang.String printable(java.lang.String s)
-
moveForward
void moveForward(int lines) throws java.io.IOException
- Throws:
java.io.IOException
-
moveBackward
void moveBackward(int lines) throws java.io.IOException
- Throws:
java.io.IOException
-
eof
private void eof()
-
bof
private void bof()
-
getStrictPositiveNumberInBuffer
int getStrictPositiveNumberInBuffer(int def)
-
nextLine2display
private Less.Pair<java.lang.Integer,AttributedString> nextLine2display(int line, java.util.regex.Pattern dpCompiled) throws java.io.IOException
- Throws:
java.io.IOException
-
prevLine2display
private Less.Pair<java.lang.Integer,AttributedString> prevLine2display(int line, java.util.regex.Pattern dpCompiled) throws java.io.IOException
- Throws:
java.io.IOException
-
toBeDisplayed
private boolean toBeDisplayed(AttributedString curLine, java.util.regex.Pattern dpCompiled)
-
display
boolean display(boolean oneScreen) throws java.io.IOException
- Throws:
java.io.IOException
-
display
boolean display(boolean oneScreen, java.lang.Integer curPos) throws java.io.IOException
- Throws:
java.io.IOException
-
getPattern
private java.util.regex.Pattern getPattern()
-
getPattern
private java.util.regex.Pattern getPattern(boolean doDisplayPattern)
-
getLine
AttributedString getLine(int line) throws java.io.IOException
- Throws:
java.io.IOException
-
checkInterrupted
public static void checkInterrupted() throws java.lang.InterruptedException
This is for long running commands to be interrupted by ctrl-c- Throws:
java.lang.InterruptedException
- if the thread has been interruped
-
bindKeys
private void bindKeys(KeyMap<Less.Operation> map)
-
-