Skip to content

Commit

Permalink
Add a redraw-line widget, fixes #53
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Dec 4, 2016
1 parent 11fa95b commit a2919c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/org/jline/reader/LineReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ public interface LineReader {
String READ_COMMAND = "read-command";
String RECURSIVE_EDIT = "recursive-edit";
String REDISPLAY = "redisplay";
String REDRAW_LINE = "redraw-line";
String REDO = "redo";
String REVERSE_MENU_COMPLETE = "reverse-menu-complete";
String SELF_INSERT = "self-insert";
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/jline/reader/impl/LineReaderImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,9 @@ public void callWidget(String name) {
/**
* Clear the line and redraw it.
*/
public void redrawLine() {
public boolean redrawLine() {
display.reset();
return true;
}

/**
Expand Down Expand Up @@ -3107,6 +3108,7 @@ protected Map<String, Widget> builtinWidgets() {
// widgets.put(QUIT, this::quit);
widgets.put(QUOTED_INSERT, this::quotedInsert);
widgets.put(REDISPLAY, this::redisplay);
widgets.put(REDRAW_LINE, this::redrawLine);
widgets.put(REDO, this::redo);
widgets.put(SELF_INSERT, this::selfInsert);
widgets.put(SELF_INSERT_UNMETA, this::selfInsertUnmeta);
Expand Down

0 comments on commit a2919c5

Please sign in to comment.