Raxol.Terminal.Commands.Editor (Raxol v0.4.0)
View SourceHandles editor-related terminal commands.
Summary
Functions
Clears a line or part of a line based on the mode parameter.
Clears the screen based on the mode parameter.
Deletes a specified number of characters starting from the current cursor position. Characters to the right of the deleted characters are shifted left, and blank characters are added at the end.
Deletes a specified number of lines starting from the current cursor position. Lines below the deleted lines are shifted up, and blank lines are added at the bottom.
Erases a specified number of characters starting from the current cursor position. Characters are replaced with blank spaces using the default style.
Inserts a specified number of blank characters at the current cursor position. Characters to the right of the cursor are shifted right, and characters shifted off the end are discarded.
Inserts a specified number of blank lines at the current cursor position. Lines below the cursor are shifted down, and lines shifted off the bottom are discarded.
Functions
@spec clear_line( Raxol.Terminal.Emulator.t(), integer(), {non_neg_integer(), non_neg_integer()}, map() ) :: Raxol.Terminal.Emulator.t()
Clears a line or part of a line based on the mode parameter.
Parameters
emulator
- The current emulator statemode
- The clear mode:- 0 - Clear from cursor to end of line
- 1 - Clear from beginning of line to cursor
- 2 - Clear entire line
Returns
- Updated emulator state
@spec clear_screen( Raxol.Terminal.Emulator.t(), integer(), {non_neg_integer(), non_neg_integer()}, map() ) :: Raxol.Terminal.Emulator.t()
Clears the screen based on the mode parameter.
Parameters
emulator
- The current emulator statemode
- The clear mode:- 0 - Clear from cursor to end of screen
- 1 - Clear from beginning of screen to cursor
- 2 - Clear entire screen
- 3 - Clear entire screen and scrollback
Returns
- Updated emulator state
@spec delete_chars( Raxol.Terminal.ScreenBuffer.t(), non_neg_integer(), non_neg_integer(), non_neg_integer(), Raxol.Terminal.ANSI.TextFormatting.text_style() ) :: Raxol.Terminal.ScreenBuffer.t()
Deletes a specified number of characters starting from the current cursor position. Characters to the right of the deleted characters are shifted left, and blank characters are added at the end.
@spec delete_lines( Raxol.Terminal.ScreenBuffer.t(), non_neg_integer(), non_neg_integer(), Raxol.Terminal.ANSI.TextFormatting.text_style() ) :: Raxol.Terminal.ScreenBuffer.t()
Deletes a specified number of lines starting from the current cursor position. Lines below the deleted lines are shifted up, and blank lines are added at the bottom.
@spec erase_chars( Raxol.Terminal.ScreenBuffer.t(), non_neg_integer(), non_neg_integer(), non_neg_integer(), Raxol.Terminal.ANSI.TextFormatting.text_style() ) :: Raxol.Terminal.ScreenBuffer.t()
Erases a specified number of characters starting from the current cursor position. Characters are replaced with blank spaces using the default style.
@spec insert_chars( Raxol.Terminal.ScreenBuffer.t(), non_neg_integer(), non_neg_integer(), non_neg_integer(), Raxol.Terminal.ANSI.TextFormatting.text_style() ) :: Raxol.Terminal.ScreenBuffer.t()
Inserts a specified number of blank characters at the current cursor position. Characters to the right of the cursor are shifted right, and characters shifted off the end are discarded.
@spec insert_lines( Raxol.Terminal.ScreenBuffer.t(), non_neg_integer(), non_neg_integer(), Raxol.Terminal.ANSI.TextFormatting.text_style() ) :: Raxol.Terminal.ScreenBuffer.t()
Inserts a specified number of blank lines at the current cursor position. Lines below the cursor are shifted down, and lines shifted off the bottom are discarded.