Package org.jline.widget
Class AutopairWidgets
- java.lang.Object
-
- org.jline.widget.Widgets
-
- org.jline.widget.AutopairWidgets
-
public class AutopairWidgets extends Widgets
Creates and manages widgets that intelligently handle matching delimiters in the console.AutopairWidgets provides functionality for automatically:
- Closing matching delimiters (brackets, quotes, etc.) when the opening delimiter is typed
- Deleting matching delimiter pairs when backspace is pressed
- Skipping over closing delimiters when they are typed and already present
This behavior is similar to what many modern code editors provide, making it easier to work with paired delimiters in the console.
Inspired by zsh-autopair: https://github.com/hlissner/zsh-autopair
-
-
Field Summary
-
Fields inherited from class org.jline.widget.Widgets
AP_BACKWARD_DELETE_CHAR, AP_INSERT, AUTOPAIR_TOGGLE, AUTOSUGGEST_TOGGLE, reader, TAILTIP_PANE, TAILTIP_TOGGLE, TT_ACCEPT_LINE
-
-
Constructor Summary
Constructors Constructor Description AutopairWidgets(org.jline.reader.LineReader reader)
AutopairWidgets(org.jline.reader.LineReader reader, boolean addCurlyBrackets)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
autopairClose()
boolean
autopairDelete()
boolean
autopairInsert()
void
disable()
void
enable()
boolean
toggle()
boolean
toggleKeyBindings()
-
Methods inherited from class org.jline.widget.Widgets
addWidget, aliasWidget, args, buffer, callWidget, clearDescription, clearTailTip, currChar, destroyDescription, executeWidget, existsWidget, getKeyMap, getWidget, lastBinding, parser, prevChar, putString, replaceBuffer, setDescription, setErrorIndex, setErrorPattern, setSuggestionType, setTailTip, tailTip
-
-