@Override public void run() { reader.setKeyMap(console.getMode().getKeyMap()); } });
return super.on(keyStroke);
@Override public EditorAction on(KeyStroke keyStroke) { switch (keyStroke.operation) { case BACKWARD_CHAR: return EditorAction.DELETE_PREV_CHAR.then(VI_INSERT); case END_OF_LINE: return EMACS.then(EditorAction.DELETE_END).then(VI_INSERT); case VI_NEXT_WORD: return EditorAction.DELETE_NEXT_WORD.then(VI_INSERT); case VI_CHANGE_TO: return EditorAction.DELETE_LINE.then(VI_INSERT); case INTERRUPT: return EditorAction.INTERRUPT.then(VI_MOVE); default: return VI_MOVE; } }
} else if (current instanceof Editor) { Editor editor = (Editor)current; EditorAction action = editor.getMode().on(key); if (action != null) { String line = editor.append(action, key.sequence); ProcessHandler.Reader reader = processHandler.editor.get(); if (reader != null) { EditorAction action = editor.getMode().on(key); if (action != null) { String s = reader.editor.append(action, key.sequence);
@Override public EditorAction on(KeyStroke keyStroke) { switch (keyStroke.operation) { case BACKWARD_CHAR: return EditorAction.DELETE_PREV_CHAR.then(VI_INSERT); case END_OF_LINE: return EMACS.then(EditorAction.DELETE_END).then(VI_INSERT); case VI_NEXT_WORD: return EditorAction.DELETE_NEXT_WORD.then(VI_INSERT); case VI_CHANGE_TO: return EditorAction.DELETE_LINE.then(VI_INSERT); case INTERRUPT: return EditorAction.INTERRUPT.then(VI_MOVE); default: return VI_MOVE; } }
return EditorAction.MOVE_PREV_WORD_AT_BEGINNING; case VI_CHANGE_TO_EOL: return EMACS.then(EditorAction.DELETE_END).then(VI_INSERT); case VI_CHANGE_TO: return CHANGE_TO; return EMACS.then(EditorAction.RIGHT).then(VI_INSERT); case VI_BEGNNING_OF_LINE_OR_ARG_DIGIT: return EditorAction.MOVE_BEGINNING; return EditorAction.CLS; default: return super.on(keyStroke);
throw new UnsupportedOperationException("Not yet handled"); } else { return super.on(keyStroke); return EditorAction.DELETE_NEXT_WORD.repeat(count).then(VI_INSERT); } else { return super.on(keyStroke); return EditorAction.MOVE_PREV_WORD_AT_END.repeat(count).then(VI_MOVE); } else { super.on(keyStroke); return EditorAction.MOVE_NEXT_WORD_BEFORE_END.repeat(count).then(VI_MOVE); } else { super.on(keyStroke); return EditorAction.DELETE_PREV_CHAR.repeat(count).then(VI_MOVE); } else { return super.on(keyStroke); return EditorAction.CHANGE_CASE.repeat(count).then(VI_MOVE); } else { return super.on(keyStroke); return new EditorAction.DeleteNextChars(count).then(VI_MOVE); } else { return super.on(keyStroke);
@Override public void run() { reader.setKeyMap(console.getMode().getKeyMap()); } });
@Override public EditorAction on(KeyStroke keyStroke) { switch (keyStroke.operation) { case BACKWARD_CHAR: return EditorAction.DELETE_PREV_CHAR.then(VI_INSERT); case END_OF_LINE: return EMACS.then(EditorAction.DELETE_END).then(VI_INSERT); case VI_NEXT_WORD: return EditorAction.DELETE_NEXT_WORD.then(VI_INSERT); case VI_CHANGE_TO: return EditorAction.DELETE_LINE.then(VI_INSERT); case INTERRUPT: return EditorAction.INTERRUPT.then(VI_MOVE); default: return VI_MOVE; } }
@Override public EditorAction on(KeyStroke keyStroke) { switch (keyStroke.operation) { case VI_YANK_TO: return EditorAction.COPY.then(VI_MOVE); case END_OF_LINE: return COPY_END_OF_LINE.then(VI_MOVE); case VI_BEGNNING_OF_LINE_OR_ARG_DIGIT: return COPY_BEGINNING_OF_LINE.then(VI_MOVE); case VI_NEXT_WORD: return EditorAction.COPY_NEXT_WORD.then(VI_MOVE); case VI_FIRST_PRINT: return EditorAction.COPY_PREV_WORD.then(VI_MOVE); case INTERRUPT: return EditorAction.INTERRUPT.then(VI_MOVE); default: return super.on(keyStroke); } }
@Override public void run() { reader.setKeyMap(console.getMode().getKeyMap()); } });
return super.on(keyStroke);
return EditorAction.MOVE_PREV_WORD_AT_BEGINNING; case VI_CHANGE_TO_EOL: return EMACS.then(EditorAction.DELETE_END).then(VI_INSERT); case VI_CHANGE_TO: return CHANGE_TO; return EMACS.then(EditorAction.RIGHT).then(VI_INSERT); case VI_BEGINNING_OF_LINE_OR_ARG_DIGIT: return EditorAction.MOVE_BEGINNING; return EditorAction.CLS; default: return super.on(keyStroke);
return super.on(keyStroke);
return EditorAction.MOVE_PREV_WORD_AT_BEGINNING; case VI_CHANGE_TO_EOL: return EMACS.then(EditorAction.DELETE_END).then(VI_INSERT); case VI_CHANGE_TO: return CHANGE_TO; return EMACS.then(EditorAction.RIGHT).then(VI_INSERT); case VI_BEGNNING_OF_LINE_OR_ARG_DIGIT: return EditorAction.MOVE_BEGINNING; return EditorAction.CLS; default: return super.on(keyStroke);
} else if (current instanceof Editor) { Editor editor = (Editor)current; EditorAction action = editor.getMode().on(key); if (action != null) { String line = editor.append(action, key.sequence); ProcessHandler.Reader reader = processHandler.editor.get(); if (reader != null) { EditorAction action = editor.getMode().on(key); if (action != null) { String s = reader.editor.append(action, key.sequence);
} else if (current instanceof Editor) { Editor editor = (Editor)current; EditorAction action = editor.getMode().on(key); if (action != null) { String line = editor.append(action, key.sequence); ProcessHandler.Reader reader = processHandler.editor.get(); if (reader != null) { EditorAction action = editor.getMode().on(key); if (action != null) { String s = reader.editor.append(action, key.sequence);