Overview

The Edit component handles some editing actions, such as delete, copy and cut.

Properties

lines

get

Returns the latest Lines instance. This is an alias of Code#Lines.


i18n

get

Returns the i18n collection. This is an alias of this.options.i18n.

Methods

delete()

delete(): void

Deletes the selected text. Nothing will happen when the selection is collapsed.


paste()

paste( string: string, type: string ): void

Pastes the provided text at the current position.

Params

string

A string to paste.

type

Optional. Specifies the input type.


copy()

copy( string?: string, skipSelection?: boolean ): void

Copies the provided text to the clipboard. If the text is not provided, this method tries to copy the current selection.

Params

string

Optional. A string to copy.

skipSelection

Optional. Whether to restore the selection range after copy or not.


cut()

cut(): void

Cuts the selected code. Nothing will happen if the selection is collapsed.


cutLine()

cutLine(): void

Cuts the current line.