Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/prompt_toolkit/cursor_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,23 @@ class ModalCursorShapeConfig(CursorShapeConfig):

def get_cursor_shape(self, application: Application[Any]) -> CursorShape:
if application.editing_mode == EditingMode.VI:
if application.vi_state.input_mode == InputMode.INSERT:
if application.vi_state.input_mode in {
InputMode.NAVIGATION,
}:
return CursorShape.BLOCK
if application.vi_state.input_mode in {
InputMode.INSERT,
InputMode.INSERT_MULTIPLE,
}:
return CursorShape.BEAM
if application.vi_state.input_mode == InputMode.REPLACE:
if application.vi_state.input_mode == {
InputMode.REPLACE,
InputMode.REPLACE_SINGLE,
}:
return CursorShape.UNDERLINE
elif application.editing_mode == EditingMode.EMACS:
# like vi's INSERT
return CursorShape.BEAM

# Default
return CursorShape.BLOCK
Expand Down
Loading