gridRef method

VtGridRefSnapshot gridRef(
  1. VtPoint point
)

Resolves a cell position within the terminal grid.

Implementation

VtGridRefSnapshot gridRef(VtPoint point) {
  _ensureOpen();
  final out = calloc<bindings.GhosttyGridRef>();
  final nativePoint = calloc<bindings.GhosttyPoint>();
  try {
    out.ref.size = ffi.sizeOf<bindings.GhosttyGridRef>();
    point._writeTo(nativePoint.ref);
    _checkResult(
      bindings.ghostty_terminal_grid_ref(_handle, nativePoint.ref, out),
      'ghostty_terminal_grid_ref',
    );
    return VtGridRefSnapshot.fromNative(out);
  } finally {
    calloc.free(nativePoint);
    calloc.free(out);
  }
}