registerTextEditorCommand method

Disposable registerTextEditorCommand(
  1. String command,
  2. void callback(
    1. TextEditor,
    2. TextEditorEdit, [
    3. Iterable?
    ]), [
  3. dynamic thisArg
])

Registers a text editor command that can be invoked via a keyboard shortcut, a menu item, an action, or directly.

Text editor commands are different from ordinary {@link commands.registerCommandcommands} as they only execute when there is an active editor when the command is called. Also, the command handler of an editor command has access to the active editor and to an {@link TextEditorEditedit}-builder. Note that the edit-builder is only valid while the callback executes.

Implementation

_i3.Disposable registerTextEditorCommand(
  _i2.String command,
  void Function(
    _i3.TextEditor,
    _i3.TextEditorEdit, [
    _i2.Iterable<_i2.dynamic>?,
  ]) callback, [
  _i2.dynamic thisArg,
]) =>
    _i4.callMethod(
      this,
      'registerTextEditorCommand',
      [
        command,
        _i4.allowInterop((
          _i3.TextEditor v0,
          _i3.TextEditorEdit v1, [
          a0,
          a1,
          a2,
          a3,
          a4,
          a5,
          a6,
          a7,
          a8,
          a9,
        ]) =>
            callback(
              v0,
              v1,
              [
                a0,
                a1,
                a2,
                a3,
                a4,
                a5,
                a6,
                a7,
                a8,
                a9,
              ],
            )),
        thisArg,
      ],
    );